solve exercise 30.22