Added tri functions