first working hack of grader 3. needs improvement