refactured the BoundingBox as datatype and also added the option to get tmax