before changing vector to deque