Exercise 2.38, 2.39 and 2.40