Created intersection function