Added new grade functionality. Needs testing.