changed method to find intersection