Initial commit, solves problems 1 and 2, starts problem 3