         return updatedPositions
     }
     
-    private func matchToEachWord(wordPositions: WordPositions, index: Int) -> [UInt8]? {
+    private func matchToEachWord2(wordPositions: WordPositions, index: Int) -> [UInt8]? {
         var updatedPositions: [UInt8] = Array(repeating: 0, count: wordPositions.numWords)
         var nextPosition: UInt8 = wordPositions.positions[0][index]
         updatedPositions[0] = nextPosition
         for wordIndex in 1..<wordPositions.numWords {
             let oneWordPositions: [UInt8] = wordPositions.positions[wordIndex]
             nextPosition += 1
-            if !oneWordPositions.contains(nextPosition) {
+            if oneWordPositions.contains(nextPosition) {
+                updatedPositions[wordIndex] = nextPosition
+            } else {
                 return nil
             }
-            updatedPositions[wordIndex] = nextPosition
         }
         return updatedPositions
     }

    * where they are entered in the consequtive order of the search parameters.
    * This search method should be used for chinese
    */
/*
    func search2(bible: Bible, words: [String]) -> [WordRef: WordPositions] {
        var finalResult = [WordRef: WordPositions]()
        let results1 = self.search1(bible: bible, words: words)
        if results1.count == 0 {
            return finalResult
        }
        for (wordRef, positions) in results1 {
            let updatedPostions = self.matchToEachReference(wordPositions: positions)
            if updatedPostions.positions[0].count > 0 {
                finalResult[wordRef] = updatedPostions
            }
        }
        return finalResult
    }
*/
    private func matchToEachReference(wordPositions: WordPositions) -> WordPositions {
        var updatedPositions = WordPositions(numWords: wordPositions.numWords)
        let firstWordPositions: [UInt8] = wordPositions.positions[0]
        for index in 0..<firstWordPositions.count {
            let matches: [UInt8]? = self.matchToEachWord(wordPositions: wordPositions, index: index)
            if matches != nil {
                updatedPositions.addReference(positions: matches!)
            }

            self.positions[wordIndex].append(positions[wordIndex])
        }
    }
    
    mutating func addIfNewReference(positions: [UInt8]) {
        for wordIndex in 0..<positions.count {
            let lastValue = self.positions[wordIndex].last
            if lastValue == nil || lastValue != positions[wordIndex] {
                self.positions[wordIndex].append(positions[wordIndex])
            }
        }
    }
}


struct ConcordanceModel {
    
    /**
    * This method searches for all verses that contain all of the words entered.
