solved problem 2, started question 5.