Started implmenting the multithreading, but having trouble.