Added REPLACE functionality