thanks to Stefan Erickson for the idea