added solution for question 4 and 5