problem 4 refactor
problem34