changed max substitution cost