fitting rectangles into each other