added the intersection function