update solution to question 4