improved sorting for student