Finished exercise 1.31