sort then pileup