added intersect function

Added a function to do set intersection of two arrays