     
     /** 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)
     }
     

                            b.append(_b[i])
                        }
                    }
                    return compute(a, B: b)
                }
            }
            else {

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