Problems 1 and 2

Finished problems 1 and 2; problem 2 still needs commenting.