a method that returns non-dupe values in a given array