Added functionality to draw rectangles