removed global var declaration from inside functions
unused args