working with many rectangles