moved global variables together