problem 11
refactoring
problem 12