Fixed the intersection point function