 
 extension Chain {
     
-    public func run(queue: Queue? = nil, _ completion: (AnyObject? -> Void)? = nil) {
+    public func run(queue: Queue? = nil, _ completion: CompletionClosure? = nil) {
         let _queue = queue?.queue ?? self.queue.queue
         self.runChain { result in
             dispatch_async(_queue) { completion?(result) }


extension Chain {
    
    public static func main(block: Void -> AnyObject?) -> Chain {
        return Chain(Queue.Main, nil, { _ in return block() })
    }
    
    public static func background(block: Void -> AnyObject?) -> Chain {
        return Chain(Queue.Background, nil,  { _ in return block() })
    }
    
    public static func userInteractive(block: Void -> AnyObject?) -> Chain {
        return Chain(Queue.UserInteractive, nil,  { _ in return block() })
    }
    
    public static func userInitiated(block: Void -> AnyObject?) -> Chain {
        return Chain(Queue.UserInitiated, nil,  { _ in return block() })
    }
    
    public static func utility(block: Void -> AnyObject?) -> Chain {
        return Chain(Queue.Utility, nil,  { _ in return block() })
    }
    
    public static func onDefault(block: Void -> AnyObject?) -> Chain {
        return Chain(Queue.Default, nil,  { _ in return block() })
    }
  
    public static func custom(queue: dispatch_queue_t, _ block: Void -> AnyObject?) -> Chain {
        return Chain(Queue.Custom(queue: queue), nil,  { _ in return block() })
    }
    
    public static func after(queue: Queue = Queue.Background, seconds: Double, _ block:  Void -> AnyObject?) -> Chain {
        return Chain(queue, nil) { _ in
            Chain.waitBlock(seconds)()
            return block()
        }
    }
    
    public static func wait(queue: Queue = Queue.Background, seconds: Double, _ block:  Void -> AnyObject?) -> Chain {
        return Chain(queue, nil) { _ in
            Chain.waitBlock(seconds)()
            return nil

import Foundation

public typealias Closure = (AnyObject? -> AnyObject?)
public typealias StartClosure = (Void -> AnyObject?)
public typealias CompletionClosure = (AnyObject? -> Void)

// MARK: - Chain Class

