Implemented the exercise.