pack rectangles