Drawing rectangles and polygons