Re-implement the queue.