used vector instead of deque