add _tri and _gauss functions