solve exercise 40.04