Fixing identification of valid intersection

When any two intersecion points have the same x coordinate or the same y coordinate it would fail. The check is valid if both the x and y coordinate of both intersections are too close instead of either.