In the current version of the scheduler, removing a task from the queue takes a lot of time. We need to find a method of improving it so it does not effect performance this much.