solve exercise 39.11