Added functionality for drawing rects