Do not use queue

I use history and tryIndex instead of queue.