problem 5 solution
problem 6 solution