Finished exercises in chapter 9

Squashed commit of the following:

commit b3c99abef15294a9c3775bf22c91f3ebaa99d4d6
commit b864c1196e462600b8e39310021651d9a3f023e5
commit a428268a9d77e10d0f7dcdb4acf7590d60880106