Batch2 implementation of grade cal