Solution to problem 30