     override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
         
         var cell : UITableViewCell!
-        let parent = self.findParent(indexPath.row)
-
-        if self.isChildCell(indexPath) {
+        
+        let (parent, isParentCell, actualPosition) = self.findParent(indexPath.row)
+        
+        if !isParentCell {
             cell = tableView.dequeueReusableCellWithIdentifier(childCellIdentifier, forIndexPath: indexPath)
-            cell.textLabel!.text = self.subItems[parent][indexPath.row - self.actualPositions[parent] - 1]
+            cell.textLabel!.text = self.dataSource[parent].childs[indexPath.row - actualPosition - 1]
             cell.backgroundColor = UIColor.greenColor()
         }
         else {
             cell = tableView.dequeueReusableCellWithIdentifier(parentCellIdentifier, forIndexPath: indexPath)
-            cell.textLabel!.text = self.topItems[parent]
+            cell.textLabel!.text = self.dataSource[parent].title
         }
         
         return cell

    
    override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
        
        guard !self.isChildCell(indexPath) else {
            NSLog("A child was tapped!!!");
            return
        }
        
        self.tableView.beginUpdates()
        
        let parent = self.findParent(indexPath.row)
        self.setExpandeOrCollapsedStateforCell(parent, index: indexPath.row)
        
        self.tableView.endUpdates()
    }
    
    override func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
        return self.isChildCell(indexPath) ? 44.0 : 64.0
    }
}
        self.tableView.insertRowsAtIndexPaths(indexPaths, withRowAnimation: UITableViewRowAnimation.Fade)
        
        // update the total of rows
        self.total += currentSubItems.count
    }
    
    /**
