inplace array reorder part II