inplace array reorder part I