 
 extension JSON {
     
-    private func _map<Key:Hashable ,Value, NewValue>(source: [Key: Value], transform: Value -> NewValue) -> [Key: NewValue] {
-        var result = [Key: NewValue](minimumCapacity:source.count)
-        for (key,value) in source {
-            result[key] = transform(value)
-        }
-        return result
-    }
-
     //Optional [String : JSON]
     public var dictionary: [String : JSON]? {
-        get {
-            if self.type == .Dictionary {
-                return _map(self.object as! [String : AnyObject]){ JSON($0) }
-            } else {
-                return nil
-            }
+        if self.type == .Dictionary {
+            return self.rawDictionary.reduce([String : JSON]()) { (dictionary: [String : JSON], element: (String, AnyObject)) -> [String : JSON] in
+                var d = dictionary
+                d[element.0] = JSON(element.1)
+                return d
+            }
+        } else {
+            return nil
         }
     }
     
     //Non-optional [String : JSON]
     public var dictionaryValue: [String : JSON] {
-        get {
-            return self.dictionary ?? [:]
-        }
+        return self.dictionary ?? [:]
     }
     
     //Optional [String : AnyObject]

            }
        }
        set {
            self.object = newValue.copy()
        }
    }
}

//MARK: - Null
extension JSON {
 
    public var null: NSNull? {
        get {
            switch self.type {
            case .Null:
                return NSNull()
            default:
                return nil
            }

    public init(_ object: AnyObject) {
        self.object = object
    }
    
    /**
    Creates a JSON from a [JSON]
    
    - parameter jsonArray: A Swift array of JSON objects
    
    - returns: The created JSON
    */
    public init(_ jsonArray:[JSON]) {
        self.init(jsonArray.map { $0.object })
    }
    
    /**
    Creates a JSON from a [String: JSON]
    
    :param: jsonDictionary A Swift dictionary of JSON objects
    
    :returns: The created JSON
    */
    public init(_ jsonDictionary:[String: JSON]) {
        var dictionary = [String: AnyObject]()
        for (key, json) in jsonDictionary {
            dictionary[key] = json.object
        }
        self.init(dictionary)
    }
    
    /// Private object
    private var rawArray: [AnyObject] = []
    private var rawDictionary: [String : AnyObject] = [:]
    private var rawString: String = ""
    private var rawNumber: NSNumber = 0
    private var rawNull: NSNull = NSNull()
    /// Private type
    private var _type: Type = .Null
    /// prviate error
    private var _error: NSError? = nil
    
    /// Object in JSON
    public var object: AnyObject {
        get {
            switch self.type {
            case .Array:
                return self.rawArray
            case .Dictionary:
                return self.rawDictionary
            case .String:
                return self.rawString
            case .Number:
                return self.rawNumber
            case .Bool:
                return self.rawNumber
            default:
                return self.rawNull
            }
        }
        set {
            _error = nil
            switch newValue {
            case let number as NSNumber:
                if number.isBool {
