refactor problem 15