the intricacies of tail recursion and lazy evaluation