Finished exercise 2.4