Solved problem 9, twas a doozy