         
         let entry = entries[index]
         
-        if (self.remindersBackedList.containsEntry(entry.title)) {
-            self.remindersBackedList.removeEntry(entry.title)
+        if (self.remindersBackedList.containsEntry(entry)) {
+            self.remindersBackedList.removeEntry(entry)
         } else {
-            self.remindersBackedList.addEntry(entry.title, withNotes: entry.detail)
+            self.remindersBackedList.addEntry(entry, withNotes: entry.detail)
         }
         
         let path = NSIndexPath(forRow: index, inSection: 0)

        let markButton = cell.viewWithTag(3) as! UIButton
        markButton.accessibilityHint = "\(indexPath.row)"
        markButton.addTarget(self, action: #selector(ViewController.toggleMarkButton(_:)), forControlEvents: UIControlEvents.TouchUpInside)
        if (self.remindersBackedList.containsEntry(entry.title)) {
            markButton.setTitle("Unmark", forState: UIControlState.Normal)
        } else {
            markButton.setTitle("Mark", forState: UIControlState.Normal)


class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {

    struct Entry: CKReminderIdentifiable {
        let title: String
        let detail: String
        
        func identificationForReminder() -> String {
            return title
        }
    }
    
    var entries = Array<Entry>()
