     }
     
     private func presentInAllSets(mapList: [[WordRef: [UInt8]]], reference: WordRef) -> WordPositions? {
-        var result = WordPositions()
-        for map in mapList {
+        var result = WordPositions(numWords: mapList.count)
+        for index in 0..<mapList.count {
+            let map = mapList[index]
             let wordPositions = map[reference]
             if wordPositions == nil {
                 return nil
             } else {
-                result.addWord(positions: wordPositions!)
+                result.addWord(word: index, positions: wordPositions!)
             }
         }
         return result

struct WordPositions {
    var positions: [[UInt8]]
    
    init() {
        self.positions = [[UInt8]]()
    }
    
    mutating func addWord(positions: [UInt8]) {
        self.positions.append(positions)
    }
}


        return finalResult
    }
    private func matchToNext(wordPositions: WordPositions, firstPosition: UInt8) -> WordPositions? {
        var updatedPositions = WordPositions(numWords: wordPositions.numWords)
        var nextPosition = firstPosition
        for index in 0..<wordPositions.numWords {
            let oneWordPositions = wordPositions.positions[index]
            if !oneWordPositions.contains(nextPosition) {
                return nil
            }
            updatedPositions.addWord(word: index, positions: [nextPosition])
            nextPosition += 1
        }
        return wordPositions
    }

    func search2old(bible: Bible, words: [String]) -> [String] {
        if words.count == 0 {
