Refactored the code
Getting the list of students from the user