Solution to problem 25