Update Triplet.c

Working for some cases but not for all