Finished Exercise for Chapter 6