     
     /** Cosine similarity **/
     private func cosineSim(A: [Double], B: [Double]) -> Double {
-        return dot(A, B: B) / (magnitude(A) * magnitude(B))
+        return dot(A: A, B: B) / (magnitude(A: A) * magnitude(A: B))
     }
     
     /** Tanimoto similarity **/
     private func tanimotoSim(A: [Double], B: [Double]) -> Double {
-        let Amag = magnitude(A)
-        let Bmag = magnitude(B)
-        let AdotB = dot(A, B: B)
+        let Amag = magnitude(A: A)
+        let Bmag = magnitude(A: B)
+        let AdotB = dot(A: A, B: B)
         return AdotB / (Amag * Amag + Bmag * Bmag - AdotB)
     }
     

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

        let a = Set(A)
        let b = Set(B)
        
        return 2.0 * Double(a.intersection(b).count) / (Double(a.count) + Double(b.count))
    }
    
    /** Hamming distance **/
