add function `remove` to remove vertices from polygons. In addition, fix a bug when iterating on zero-length polygons