finished exercise 4.14