         if let image = generateQRImageFromString(input, errorCorrection, size) {
             
             if let URL = NSURL(fileURLWithPath:path) {
-                let destination : CGImageDestinationRef = CGImageDestinationCreateWithURL(URL, imageType, 1, nil)
+                let destination = CGImageDestinationCreateWithURL(URL, imageType, 1, nil)
                 CGImageDestinationAddImage(destination, image, nil);
                 if CGImageDestinationFinalize(destination) {
                     exit(0)

    let image = filter.outputImage
    
    let extent = CGRectIntegral(image.extent())
    let scale = min(sideLength / CGRectGetWidth(extent), sideLength / CGRectGetHeight(extent));
    let width = CGRectGetWidth(extent) * scale;
    let height = CGRectGetHeight(extent) * scale;
    let colorspace = CGColorSpaceCreateDeviceGray()
    let alphaMask = CGBitmapInfo(rawValue:CGImageAlphaInfo.None.rawValue)
    let bitmapRef = CGBitmapContextCreate(nil, UInt(width), UInt(height), 8, 4 * UInt(sideLength), colorspace, alphaMask)
    let context = CIContext(CGContext:bitmapRef, options:nil)
    
    let bitmapImage = context.createCGImage(image, fromRect:extent)

            imageType = kUTTypeGIF
            
        default:
            type = "png"
        }
        
        fileExtension = type
    }
    
    var errorCorrection = "M"
    if let correction = userDefaults.stringForKey("e") {
        if contains(["L", "Q", "H"], correction) {
            errorCorrection = correction
        }
    }
