function unionPolygons added