Removed assignments that accidentally created gloabal variables.
Removed references to non-existent globals.