Finished question 3 for assignment 2