finished exercise, had to do a couple hack fixes, needs refactored