updated substitute method and added some more functions for pure symbolic execution