Removed unecessary global variables