added isTriangular() method.