updated triangle matrix template