solving the interval calc for intersections