add grades and sorter code