     private var errorBlock: ErrorBlock?
     private var finallyBlock: (()->())?
     private var childFuture: Future?
-
-    let lockQueue = DispatchQueue(label: "com.concurrency.future.\(NSUUID().uuidString)")
+    fileprivate var result: Result<T>?
+    
+    private let lockQueue = DispatchQueue(label: "com.concurrency.future.\(NSUUID().uuidString)")
 
     //MARK: - PUBLIC -
     
-    fileprivate(set) var value: T?
-    fileprivate(set) var error: Error?
+    //MARK: public properties
+    
+    var value: T? {
+        guard let result = result else {
+            return nil
+        }
+        switch result {
+        case .success(let val):
+            return val
+        default:
+            return nil
+        }
+    }
+    
+    var error: Error? {
+        guard let result = result else {
+            return nil
+        }
+        switch result {
+        case .error(let err):
+            return err
+        default:
+            return nil
+        }
+    }
     
     public var succeeded: Bool {
         return value != nil

    public var isComplete: Bool {
        return succeeded || failed
    }

    @discardableResult public func then(_ callback: @escaping ThenBlock) -> Future<T> {
        if let value = self.value { //If the future has already been resolved with a value. Call the block immediately.

    
    public static func preResolved(value: T) -> Future<T> {
        let future = Future<T>()
        future.result = .success(value)
        return future
    }
    
    public static func preRejected(error: Error) -> Future<T> {
        let future = Future<T>()
        future.result = .error(error)
        return future
    }
    
