     }
 }
 
-
 class JaroDistance {
-    
-    var firstString = ""
-    var lastString = ""
     
     let INDEX_NOT_FOUND = -1
     let EMPTY = ""
     let SPACE = " "
     
-    init(firstString: String, lastString: String) {
-        self.firstString = firstString
-        self.lastString = lastString
-    }
-    
-    
-    func getJaroWinklerDistance() -> Float {
+    
+    func getJaroWinklerDistance(#firstWord : String, secondWord : String) -> Float {
         
         let defaultScalingFactor : Float = 0.1
         
-        let jaro = Float(self.score())
-        let cp = Float(self.commonPrefixLength(first: self.firstString, second: self.lastString))
+        let jaro = Float(self.score(firstString: firstWord, secondString: secondWord))
+        let cp = Float(self.commonPrefixLength(first: firstWord, second: secondWord))
         
         let matchScore : Float = jaro + defaultScalingFactor * Float(cp) * Float(1 - jaro)
         return matchScore

}


let jaro = JaroDistance(firstString: "martha", lastString: "marhta")
let d = jaro.getJaroWinklerDistance()
println("distance : \(d)")   // distance: 0.9611


let jaro1 = JaroDistance(firstString: "Hello", lastString: "hey")
let d1 = jaro1.getJaroWinklerDistance()
println("distance : \(d1)") // distance: 0.688



            let ch = String(Array(first)[i])
            
            // See if the character is within the limit positions away from the original position of that character.
            let jStart = max(0, i - limit)
            let jEnd = min(i + limit, count(second))
            
            if jStart < jEnd {
                for j in jStart ..< jEnd {
                    if String(Array(copy)[j]) == ch {
                        common = common + ch
                        let nsRange : NSRange = NSRange(location: j, length: 1)
