Solution to problem 29