Added multithreading and a task queue.