Updated substitutin method.