Adding bounding box calculation