Added deque code