adding question 3 code/answer
adding q3