solve exercise 31.07