solve exercise 17.1