fixed
added function to determine the intersection