Finish exercise chapter 9