Use direct recursion instead of mutable stacks, like the original implementation. The mutable stacks do offer protection from stack overflows, but those are rare anyway and the mutable stacks do impact performance.