continuing work on replace mode.