implemented initial version of drawing rectangle.