simple deque implementation