createBoundBox function

Calculate a bounding box