Changed Variables to global