implemented obtaining contour of intersection