make several local variable to global variable
make most of local variables to global variables