solve exercise 24.12