Added code for Exercise 10.