         
         // insertions should alwyas happen to the new section's place
         insertsIndexPaths.append(contentsOf: inserts.map { IndexPath(item: $0, section: entry.new) })
+        
       }
       
       

      let newSectionsMeta = list.sections.map({$0.metadata})
      
      // perform diff on metadata to figure out inserted sections and deleted sections
      let metaDiff = Array.diff(oldSectionsMeta, newSectionsMeta)
      
      var sectionDeletes: [Int] = []
      var sectionInserts: [Int] = []
      sectionDeletes.reserveCapacity(metaDiff.count)
      sectionInserts.reserveCapacity(metaDiff.count)
      
      for diffStep in metaDiff {
        switch diffStep {
        case .insert(_, let index):
          sectionInserts.append(index)
        case .delete(_, let index):
          sectionDeletes.append(index)
        }
      }
      
      // get sections that stayed a.k.a neither deleted nor inserted
      var sectionsSame: [(new: Int, old: Int)] = []
      for (i, entry) in newSectionsMeta.enumerated() {
        if let oldIndex = oldSectionsMeta.index(of: entry) {
          // TODO: make sure this section is not in sectionDeletes or sectionInserts
          sectionsSame.append((new: i, old: oldIndex))
          
        }

      
      var deletesIndexPaths: [IndexPath] = []
      var insertsIndexPaths: [IndexPath] = []
      var movesIndexPaths: [(from: IndexPath, to: IndexPath)] = []
      
      // perform diff on sectionsSame items to get indecies that where deleted, inserted and moved inside those sections
      for entry in sectionsSame {
        
        // the diff should happen between old section's items and new section's items on their corresponding indecies
        let diff = sections[entry.old].items.extendedDiff(list[entry.new].items)
        let patch = diff.patch(from: sections[entry.old].items, to: list[entry.new].items)

        //let diff = Array.diff(sections[entry.old].items, list[entry.new].items)
        
        var deletes: [Int] = []
        var inserts: [Int] = []
        deletes.reserveCapacity(diff.count)
        inserts.reserveCapacity(diff.count)

        
        for diffStep in patch {
          switch diffStep {
          case .insertion(let index, _):
            inserts.append(index)
          case .deletion(let index):
            deletes.append(index)
          case .move(let from, let to):
            movesIndexPaths.append((IndexPath(item: from, section: entry.new), IndexPath(item: to, section: entry.new)))
          }
        }
        
