changed replace.cpp