introduced new faster version of get_n_cycles_...