updated to remove duplicates