calculating the total number of students now works