Cycle calculation