tested intersect function