modified whetherIntersect.java