Replacing list and stack with array based deque.
Update to array and vector.