added sample code for querying objects from Core Data