auto exchange sort