Solution to problem 17