solve exercise 17.7