Added existsTriangle method