finish sorting algorithm  for sorting by customers