Finished implementation of the Thread library