Setting up the rectangle tree