refactored problem 4
refactored problem 5