Implemented grade calculations so it is up to date with 7f978a64dbd41c5eaad92f18ffb809597d76d54c