Updated exercise-2 with changes from solution