added a new replacement method