Solved Problem 22.  Fun problem.