Refactored input_students to use while instead of loop