solve exercise 18.01