Start of model evaluation code