fix cycle bug
fix cycles / curves heuristic once and for all