completed problem 2

yay for recursion!