Completed second part of the exercise.