A `while` loop is probably preferable to recursion.