added In and Intersect template functions