Finished part a of question 1, started on part b.