Update replace.cpp