Solution to problem 14