Added solution to problem 14. Converted some functions to use the
recursive form.