partition reorder function working