Checking in latest changes to grading algorithm