finish code grade.js. it have bugs