finished exercise 4.1