Reorganised boxes code
Better implementation of unit_rects
Box z order
Added missing import