Changed vector<bool> to deque<bool>.