use sets to remove duplicates