Finished exercise 3.3.b