First draft for "replace mode"