solve exercise 22.16