sorting a set using min max sorted and zip