updated Deque implementation