update with working polygonization