added globals for counters