sort triangles