added replaceVar method testing