uploaded refactored solution 3, 4 errors left