solve exercise 25.18