ruby script for grading