         let a = Set(A)
         let b = Set(B)
         
-        return Double(a.intersect(b).count) / sqrt(Double(a.count) * Double(b.count))
+        return Double(a.intersection(b).count) / sqrt(Double(a.count) * Double(b.count))
     }
     
     /** Jaccard index **/

        
        switch mode {
        case .Cosine:
            return cosineSim(A, B: B)
        case .Tanimoto:
            return tanimotoSim(A, B: B)
        case .Ochiai:
            return ochiaiSim(A, B: B)
        case .JaccardIndex:
            return jaccardIndex(A, B: B)
        case .JaccardDistance:
            return jaccardDist(A, B: B)
        case .Dice:
            return diceCoef(A, B: B)
        case .Hamming:
            return hammingDist(A, B: B)
        }
    }
}

        let a = Set(A)
        let b = Set(B)
        
        return Double(a.intersection(b).count) / Double(a.union(b).count)
    }
    
    /** Jaccard distance **/
    private func jaccardDist(A: [Double], B: [Double]) -> Double {
        return 1.0 - jaccardIndex(A: A, B: B)
    }
    
    /** Dice coeeficient **/
