Refactored Problem9
Merged
Refactored Problem 9