Finished exercise 5.30