Refactored the code by replacing the array of students with a hash