Replaced old deque by new and faster deque