implemented calcBoundingBox