exchange sort works