New function SetPolygons added