Congruence: iter_roots function; implemented cycles function