Added code for question 4