Grouping intersecting curves

Hello everyone! I’m trying to group all the lines that intersect with each other so that the ‘one’ list contains elements from the ‘two’ list only if they intersect with any of the elements previously added to ‘one’. The problem is that I’m getting only 2-3 elements in the result, whereas there should be more in the end.

two = IN[0]
outer = []


s = 0

while s < (len(two)):
    one = []
    one.append(two[0])
    two.pop(0)
    b = 0
    while b<(len(two)):
        counter = 0
        for z in one:
            if z.DoesIntersect(two[b]):
                counter = counter + 1        
        if counter > 0:
            one.append(two[b])
            two.pop(b)
        else:
            b = b + 1                      
    outer.append(one)
    s = s + 1

OUT = outer

Arrrh didnt read it right ;))