Finished question 1 of assignment2