Moved writing of results outside of models/obs loops