Solution to problem 34