Changed sort algorithm of shreds.