added the skip counting logic