declared global variables as static and/or volatile