added a new method to draw the rectangle.