solve exercise 24.24