finished exercise 1 and 2, almost done with exercise 3