Polygon class implementation