removes duplicates of an array