     private func parseNumber(index: Int) -> (JSON, Int) {
         let cursor = eatWhiteSpace(index)
         let lastIndex = getLastIndexOfNumber(cursor)
-        let substr = string[Range(start: cursor, end: lastIndex)]
-        if  let number = Double(String(substr)) {
+        var substr = ""
+        for x in  cursor..<lastIndex {
+            substr.append(string[x])
+        }
+        if  let number = Double(substr) {
             return (JSON(floatLiteral: number), lastIndex)
         }
         return (.None("invalid json: \(substr) is not a valid number."), lastIndex)

    }
    
    func dumpString(inout string: Swift.String, jsonString: Swift.String) {
        let rs : Character = "\\"
        let s : Character = "/"
        let q : Character = "\""
        let b : Character = "b"
        let f : Character = "f"
        let n : Character = "n"
        let r : Character = "r"
        let t : Character = "t"
        
        string.append(q)
        for ch in jsonString.characters {

    }
    
    func dumpObject(inout string: Swift.String, object: [Swift.String : JSON]) {
        let comma : UnicodeScalar = ","
        let open : UnicodeScalar = "{"
        let close : UnicodeScalar = "}"
        let colon : UnicodeScalar = ":"
        string.append(open)
        for (k, v) in object {
            dumpString(&string, jsonString: k)
