converted the AddChar/RemoveChar statements to Var parameters