Completed the chapter 5 exercises