Fix numberInCycle method