short sub to filter duplicates from an array