exercise 3.40 done