 struct WordPositions {
     var positions: [[UInt8]]
     
-    init() {
-        self.positions = [[UInt8]]()
-    }
-    
-    mutating func addWord(positions: [UInt8]) {
-        self.positions.append(positions)
+    init(numWords: Int) {
+        self.positions = Array(repeating: [UInt8](), count: numWords)
+    }
+    
+    var numWords: Int {
+        return self.positions.count
+    }
+    
+    mutating func addWord(word: Int, positions: [UInt8]) {
+        self.positions[word] = positions
     }
 }
 

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

        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 {
