Extracted the grader function from the main method
Extracted methods to make easier to see