added tri.c