Added iteration loop
generalized functions for polygons