intersecting_segments.py [buggy]