finding intersections for arbitrary roots