solve exercise 24.21