completed Deque implementation