Added code for iteration 3