added some question 2 code