Almost finished exercise 4