updated triple code