Correction of typo in my previous answer: ... that all variables in a function should either be local OR declared in some way ... (the initial text may have been difficult to understand)