add exercise 3.39-3.51