refactoring - using the each method to iterate through each student in the array