use vector instead of deque, for performance