         return input.stringByReplacingOccurrencesOfString("\n", withString: ",").componentsSeparatedByString(",") as [NSString]
     }
     
-    private func splitLine(input: String, delimiter: String) -> (String, String) {
+    private func splitLine(input: NSString, delimiter: NSString) -> (NSString, NSString) {
         let array = input.componentsSeparatedByString(delimiter)
-        return (array.first!, array.last!)
+        return (array.first! as NSString, array.last! as NSString)
     }
     
     /**
     Convert [(String, String)] array of tuples into a [CLLocationCoordinate2D]
     */
-    private func convertToCoordinates(pairs: [(String, String)], longitudeFirst: Bool) -> [CLLocationCoordinate2D] {
+    private func convertToCoordinates(pairs: [(NSString, NSString)], longitudeFirst: Bool) -> [CLLocationCoordinate2D] {
         var coordinates = [CLLocationCoordinate2D]()
         for pair in pairs {
             var lat: Double = 0.0
             var lng: Double = 0.0
             if longitudeFirst {
-                lat = (pair.1 as NSString).doubleValue
-                lng = (pair.0 as NSString).doubleValue
+                lat = pair.1.doubleValue
+                lng = pair.0.doubleValue
             } else {
-                lat = (pair.0 as NSString).doubleValue
-                lng = (pair.1 as NSString).doubleValue
+                lat = pair.0.doubleValue
+                lng = pair.1.doubleValue
             }
             coordinates.append(CLLocationCoordinate2D(latitude: lat, longitude: lng))
         }

            var polygons = [NSString]()
            
            if isMultipolygon(line) {
                polygons = stripExtraneousCharacters(line).componentsSeparatedByString("),")
            } else {
                polygons = [stripExtraneousCharacters(line)]
            }

    input  => "MULTIPOLYGON((( 15 32 )))"
    output => "( 15 32 )"
    */
    private func stripExtraneousCharacters(input: NSString) -> NSString {
        let regex = NSRegularExpression(pattern: "\\w+\\s+\\(\\((.*)\\)\\)", options: .CaseInsensitive, error: nil)
        let match: AnyObject? = regex?.matchesInString(input, options: .ReportCompletion, range: NSMakeRange(0, input.length)).first
        let range = match?.rangeAtIndex(1)
        
        let loc = range?.location as Int!
        let len = range?.length as Int!
        
        return (input as NSString).substringWithRange(NSRange(location: loc, length: len)) as NSString
    }
    
    private func isPolygon(input: String) -> Bool {
