solve exercise 27.18