Add deque and popping functions