Add a queue, and resolve some problems in the stack.