Using a queue instead of an array list for the task container