Add triangle length counter logic.