Corrected for impossible negative numbers, probably counters being reset