looks like the right container for this would be a deque