solution for question 2