added method to draw a rectangle