Here is my confession: The "wobbly bit" came from from a document sent to me.In the true spirit of programming, I plagiarised (Even though the code was easy to understand and I could write it - just never thought of it) something from somewhere that reached me. I just added colours and modified it to make applicable to a thread...
Jon