removed duplication - centralized addTriangle logic