Refine code, add bounding box & sphere