First implemented find_cycles