Finished the Chapter 7 exercise