Added updateState and reset grades functionalities