      - Parameter handler:  A MapHandler
      */
     
-    public func map(pattern: String, queue: dispatch_queue_t = dispatch_get_main_queue(), handler: MapHandler) -> Void {
-        dispatch_barrier_async(accessQueue) {
-            self.maps.insert(self.prepare(pattern, queue: queue, handler: handler), atIndex: 0)
-        }
+    public func map(pattern: String,
+        queue: dispatch_queue_t = dispatch_get_main_queue(),
+        handler: MapHandler) -> Void {
+            dispatch_barrier_async(accessQueue) {
+                self.maps.insert(self.prepare(pattern, queue: queue, handler: handler), atIndex: 0)
+            }
     }
     
     /**
-     Associates a closure to a string pattern. A Routing instance will execute the closure in the event of a matching URL using #open.
-     Routing will execute all proxies unless #next() is called with non nil arguments.
+     Associates a closure to a string pattern. A Routing instance will execute the closure in the
+     event of a matching URL using #open. Routing will execute all proxies unless #next() is called
+     with non nil arguments.
      
      ```code
      let router = Routing()
      router.proxy("routing://route") { route, parameters, next in
-        next(route, parameters) // Must call next or the router will halt!
-        /* alternatively, next(nil, nil) allowing additional proxies to execute */
+     next(route, parameters) // Must call next or the router will halt!
+     /* alternatively, next(nil, nil) allowing additional proxies to execute */
      }
      ```
      

                            }
                        }
                        dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER)
                        if overwrittingRoute != nil || overwrittingParameters != nil { break }
                    }

                    if let (queue, handler, parameters) = (overwrittingRoute.map { self.filterRoute($0, routes: maps).first } ?? routeComponents) {
                        var parameters = parameters
                        (overwrittingParameters ?? queryParameters).forEach { parameters[$0.0] = $0.1 }
                        dispatch_async(queue) { handler(parameters) { dispatch_semaphore_signal(semaphore) } }
                        dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER)
                    }
                }
            }

        return false
    }
    
    private func prepare<H>(var pattern: String,
        queue: dispatch_queue_t,
        handler: H) -> ((String) -> (dispatch_queue_t, H?, Parameters)) {
            var dynamicSegments = [String]()
            while let range = pattern.rangeOfString(":[a-zA-Z0-9-_]+",
                options: [.RegularExpressionSearch, .CaseInsensitiveSearch]) {
                    dynamicSegments
                        .append(pattern.substringWithRange(range)
                            .stringByReplacingOccurrencesOfString(":", withString: ""))
                    pattern.replaceRange(range, with: "([^/]+)")
            }
            
            return { (route: String) -> (dispatch_queue_t, H?, Parameters) in
                guard let matches = (try? NSRegularExpression(pattern: pattern, options: .CaseInsensitive))
                    .flatMap({ $0.matchesInString(route,
                        options: [],
                        range: NSMakeRange(0, route.characters.count)) })?
                    .first
                    else {
                        return (queue, nil, [:])
                }
                
                var parameters = Parameters()
                if dynamicSegments.count > 0 && dynamicSegments.count == matches.numberOfRanges - 1 {
                    [Int](1 ..< matches.numberOfRanges).forEach { (index) in
                        parameters[dynamicSegments[index-1]] = (route as NSString)
                            .substringWithRange(matches.rangeAtIndex(index))
                    }
                }
                return (queue, handler, parameters)
            }
    }
    
    private func filterRoute<H>(route: String,
        routes: [(String) -> (dispatch_queue_t, H?, Parameters)]) -> [(dispatch_queue_t, H, Parameters)] {
            return routes
                .map { $0(route) }
                .filter { $0.1 != nil }
                .map { ($0, $1!, $2) }
    }
    
}
