Removed parentheses.
Changed global variables to local.