updating the bounding box function