Added replace method
replace test fixed