Changed the stack for an ArrayDeque, that's not synchronized