function for finding triangles works ... but the program crashes with the old inte-level algorithm circuit finding.