Fixed global variables/returning variable values