Revert "Revert "the intricacies of tail recursion and lazy evaluation""

This reverts commit 8268200731ce5a59816cf78c8f1664d56fd1e871.