Problem 17 complete
Refactor Problem 17