added function that compares 2 arrays and returns common values