Solution to problem 11