moved all vars out of global scope.