solve exercise 31.13