Finished exercise 9.1-9.5