Added additional logic for absent and present students.