fixed assumption that diff < 5

fixed the assumption that the number of skipped frames would be less
than 5, and made it so it explicitly checks for the two counter max's.