Completed the exercises for chapter 5.