Added code for drawing rectangles