Added support for global variables in the code generator