adding triangulate functions