solve exercise 19.18