Solution to problem 13
Solution to problem 14