updated grade functionality