sort only once for slice