finished exercise 1 in assignment 3