Restored working tria.cc