add find intersection function