new approach to global variables