Refactored Problem Five