solve exercise 17.8