adds comparator to collection for list sorting