finished exercise 1 of assignment 4