fold in sorting