added grades calculations