implemented resizing rectangles