Added some test thread code