Problem 15 solution and some cleanup.