Implemented basic variable replacement