This paper describes a method of rearranging data in a computer, so as to minimize the amount of storage space used. Expressions for the mean and variance of the numbers of comparisons necessary, are produced. These are compared with the number of comparisons required in a merging procedure.