Linear sort procedure.