Completed Core Data implementation