Finished exercise #9 in chapter 9.