Finished exercise 2.7.