separated bounding box builder functino