generalized boxes_overlap()