Change rectangles to polygons