refactored the names of the global variables