counter = if (counter >= 2999) 0 else counter + 1