calculatecycle method