Added charReplace function