Fixed the cycle count bug

It now does not counts every place in the cycle as a separate cycles, but only once