New prototype for the function createPolygon