please check the global variable part, some are shared variables