[assignment_5] final version of the exercise.