added drawPolygon function