completed exercises from chapter 5