More tweaking of new code for model