switched up the thread pool implementation for tasks