New sorting method