Initial version
I put here my code from 2009 as there is still some use for it