orders of global variables and function declarations are now OK