I'm moving this one up to the Experts but I'm going to take the slightly unusual step of locking it for Mr Scharoo, since he's already posted the correct answer but I had to remove it since he was an Expert!
Await your re-post of the answer Mr Scharoo!