updated models and core data sorting