Fixing things with global vars