Hi cwmaddy

I've browsed through your code. You code quite well and this will take a little time to understand. However, from your problem descriptions, it looks like you are having some stack related issues. That is why you find the serout repeating without reason. The random hanging also indicates a stack failure. I suggest you check on the nesting levels.