first large commit, solutions to problems 1 & 2