finished exercise 3.2