Minor modifications to grading prog for functionality.