sorting out global variables