cleaned up new cycle-counting logic.