fix cadence calculation