 
 class ChecklistViewController: UITableViewController {
   
-  var row0item: ChecklistItem
-  var row1item: ChecklistItem
-  var row2item: ChecklistItem
-  var row3item: ChecklistItem
-  var row4item: ChecklistItem
+  var checkListItems = [ChecklistItem]()
   
   required init?(coder aDecoder: NSCoder) {
-    row0item = ChecklistItem()
+    let row0item = ChecklistItem()
     row0item.text = "Walk the fish."
     row0item.checked = false
+    checkListItems.append(row0item)
 
-    row1item = ChecklistItem()
+    let row1item = ChecklistItem()
     row1item.text = "Massage my neck."
     row1item.checked = false
+    checkListItems.append(row0item)
     
-    row2item = ChecklistItem()
+    let row2item = ChecklistItem()
     row2item.text = "Learn singing."
     row2item.checked = false
+    checkListItems.append(row0item)
     
-    row3item = ChecklistItem()
+    let row3item = ChecklistItem()
     row3item.text = "ASMR practice."
     row3item.checked = false
+    checkListItems.append(row0item)
     
-    row4item = ChecklistItem()
+    let row4item = ChecklistItem()
     row4item.text = "Eat File Wellington."
     row4item.checked = false
+    checkListItems.append(row0item)
     
     super.init(coder: aDecoder)
     

    // MARK: Table delegate methods
  override func tableView(tableView: UITableView, didDeselectRowAtIndexPath indexPath: NSIndexPath) {
    if let cell = tableView.cellForRowAtIndexPath(indexPath) {
      
      switch indexPath.row {
        
      case (0):
        row0item.checked = !row0item.checked
        
      case (1):
        row1item.checked = !row1item.checked

      case (2):
        row2item.checked = !row2item.checked
        
      case (3):
        row3item.checked = !row3item.checked
        
      case (4):
        row4item.checked = !row4item.checked
      default: break

      }
        configureCheckmarkForCell(cell, indexPath: indexPath)
      
    }

  
  override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
    let cell = tableView.dequeueReusableCellWithIdentifier("ChecklistItem", forIndexPath: indexPath)
    let checklistItem = checkListItems[indexPath.row]
    
    let label = cell.viewWithTag(1000) as? UILabel
    label?.text = checklistItem.text
    
    configureCheckmarkForCell(cell, indexPath: indexPath)
    
