replacing get_tree_w with triangulate