Optimization of grade list processing.
Reduced the number of traversals from 3 to 1 to make the page faster