     return p.deferred
 }
 
+/**
+
+    Creates a new Deferred by filtering the value of the current Deferred with a predicate `p`
+
+    :param: dx Deferred
+    :param: p Predicate function
+    :param: ec Execution context of `p`
+
+    :returns: A new Deferred with value or nil
+
+*/
 public func filter<D: DeferredType>(dx: D, p: D.Element -> Bool)(_ ec: ExecutionContextType) -> Deferred<D.Element?> {
     return map(dx) { x in p(x) ? x : nil }(ec)
 }
 
+/**
+
+    Zips two deferred together and returns a new Deferred which contains a tuple of two elements
+
+    :param: da First deferred
+    :param: db Second deferred
+
+    :returns: Deferred with resuls of two deferreds
+
+*/
 public func zip<DA: DeferredType, DB: DeferredType>(da: DA, db: DB) -> Deferred<(DA.Element, DB.Element)> {
     
     let ec = ExecutionContext.DefaultPureOperationContext

    return p.deferred
}

public func forced<D: DeferredType>(dx: D) -> D.Element {
    return forced(dx, NSTimeInterval.infinity)!
}

public func forced<D: DeferredType>(dx: D, interval: NSTimeInterval) -> D.Element? {
    return await(interval) { completion in
        dx.onComplete(ExecutionContext.DefaultPureOperationContext, completion)


import typealias Foundation.NSTimeInterval

/**

    Applies the side-effecting function to the result of this deferred,
    and returns a new deferred with the result of this deferred

    :param: dx Deferred
    :param: f side-effecting function that will be applied to result of `dx`
    :param: ec execution context of `f` function

    :returns: a new Deferred

*/
public func andThen<D: DeferredType>(dx: D, f: D.Element -> Void)(_ ec: ExecutionContextType) -> Deferred<D.Element> {
    let p = PurePromise<D.Element>()
    dx.onComplete(ec) { value in
