adding a replaceInput flag