Solution to problem 5
Solution for problem 7
Solution to problem 9
small modification to problem 9.