adding code for Exercise 37