solve exercise 22.22