add solution for question 6