finished exercise 10 (for real this time)