changing global variables to local and pointer