Refactored Problem5
Refactored Problem5