modified grade.js