@stefanpenner I'm checking it too. I think you're right, they could be optimized but they're currently not optimized.

The same result could be achieved by *trampolining* recursive calls, but I think I'll reimplement it iteratively as you suggested.