Streamlined the math for bounding boxes