solve exercise 27.17