Completed homework for chapter 5