added replace command
added test cases