attempt number 3 for global vars