Well played, Adam.
Thanks for that. The code (as stated won't compile, but you might find something of interest in there :)