Added threading.  Incomplete