added some functions to get the intersections.