Working first half of assignment 3, except for some organization + commenting