Add revert grade function