solve exercise 31.14