Triangulate code nearly done.