refactored Deque to simplify Steque