Adding grade Function