implementing the CoreData to store the data