Tweaks to the model function