problem 3 solution
problem 5
problem 6
problem 7