Add a replace method