Changed counters from ints to longs to prevent overflow