exercise 3.31 done