first implementation of the Deque class