revise first part of smt encoding