uploaded refactored solution 4 in-progress