have no more invalid syntax. still need to fix the global variable issue