So this will let you declare avg. The problem is that the method averageGrades could not find sum or gradesarray because those two variables were declared in the main method, and thus not visible to the method.