Changed to global variables