thread

thread code written long long ago