solve exercise 24.22