Added inline documnetation to s:replace_word()