added function to check the number of names in common between two arrays