working, but ugly, grader.js