Solution to question 7