Thanks jmcilhinney - thats actually a page that I've been trying to get my head around. Perhaps its because thats in C# which I don't have so much experience with, but I can't seem to relate that to my solution.

I guess I'll have to go back and read through it again.