Updated Polygon Code