formatting and corrected search to eliminate duplicates