Added replacement functionality.