solve exercise 40.10