solve exercise 39.10