Updated the model discretization function