removed global variables