Inplace version