Refactored P03 to recur on the function itself.