Updated exercise-3 with changes from solution