solve exercise 31.09