finished the grades function