// added experimental inplace option