Final version of the grade base code.