added a function to scrape redundent legends