Converted all global variables to regular ones.