fixed collapseDuplicates, added randomize

everything actually works now! woohoo