Using collections.deque instead of Queue.Queue and queue.Queue