Created method for drawing rectangle