it is the messy code of set Tx.