added multi-polygon functionality