slice and sort