rewrote threading code; pause and resume work now.