Added support for Polygons.
updated for polygons integration,