update solution to question 30