adapt a better way to figure out how many cycles were there in the run.