Added deque code.