new global variables, minor fixes