solve exercise 31.08