Sorted out global variables