working on dedup sub segments