Moved update_grades to a reasonable spot so that it is only called when necessary