Updated exercise-5 with changes from solution