Added replacement functionality