initial scoring and grading code