Updated code to save / load from core data