Finished question 3 for Exercise 7.