solve exercise 30.21