solve exercise 30.17