removed 2 more unnecessary globals