Finished exercise C