Removed unnecessary variables from global and added it where still missing.