Fixing cycle detection.  Finds all min cycles