Grades logic