Sample from chapter 8. Recursive vs iterative.