added a solution to question 16