created test for cycle detection.