Started the collapseDuplicates method
Worked on collapseDuplicates()