Finished exercise 3.1