In reply to Bart Jablonski.

Hi Bart,
Great to hear that my blog post inspired you, and thank you for sharing your solution. (I did format your code, so please double check it to make sure I did not introduce any errors.)
Best regards,
Leonid