Added forEach loop to solve exercise.