finished exercise 4.13