Error in grading even after making changes with respect to global variables

Here is a thread that describes the most common error on this function. If that’s not it, then you need to give us more information about your situation. E.g. start by showing us what the “Show Grader Output” gives you.