added functionality to draw rectangles