refactored with methods
asked for input of student names