working test phase and variable replacement