Removed unnecessary code

Removed some global statements and variable assignments