solve exercise 40.02