Added code for inferring new models.