Get code working with both types of triangles