qbbox function

computes bounding box