The code from my blog on www.corniel.nl/blog.