Draft algorithm of segment intersections (neither working or buildable yet).