fix up bounding box code