Finished chapter 9 exercises, added tests etc