rewrote all the algorithms computations for the bounds of the model to be as much generic as possible