solve exercise 30.12