exercise 2.18 completed