Train prob- quick sorting method