Completed exercises from chapter 9