solve exercise 27.22