implemented some methods for deque