     var passThroughTimeRanges:[NSValue] = [NSValue]()
     var transitionTimeRanges:[NSValue] = [NSValue]()
     var cursorTime = kCMTimeZero
-            
-    for (var i = 0 ; i < assetsWithVideoTracks.count ; ++i)
-    {
-        let asset = assetsWithVideoTracks[i]
-        var timeRange = CMTimeRangeMake(cursorTime, asset.duration)
-        
-        if i > 0 {
+    
+    for (index, videoAsset) in enumerate(assetsWithVideoTracks) {
+        var timeRange = CMTimeRangeMake(cursorTime, videoAsset.duration)
+        if index > 0 {
             timeRange.start = CMTimeAdd(timeRange.start, transDuration)
             timeRange.duration = CMTimeSubtract(timeRange.duration, transDuration)
         }
         
-        if i + 1 < assetsWithVideoTracks.count {
+        if index + 1 < assetsWithVideoTracks.count {
             timeRange.duration = CMTimeSubtract(timeRange.duration, transDuration)
         }
         
         passThroughTimeRanges.append(NSValue(CMTimeRange: timeRange))
-        cursorTime = CMTimeAdd(cursorTime, asset.duration)
+        cursorTime = CMTimeAdd(cursorTime, videoAsset.duration)
         cursorTime = CMTimeSubtract(cursorTime, transDuration)
-        // println("cursorTime.value: \(cursorTime.value)")
-        // println("cursorTime.timescale: \(cursorTime.timescale)")
         
-        if i + 1 < assetsWithVideoTracks.count {
+        if index + 1 < assetsWithVideoTracks.count {
             timeRange = CMTimeRangeMake(cursorTime, transDuration)
-            // println("timeRange start value: \(timeRange.start.value)")
-            // println("timeRange start timescale: \(timeRange.start.timescale)")
             transitionTimeRanges.append(NSValue(CMTimeRange: timeRange))
         }
     }
+
     return (passThroughTimeRanges, transitionTimeRanges)
 }
 

    "~/Movies/clips/410_clip6.mov"
]

// Convert the file paths into URLS after expanding any tildes in the path
let urls = movieFilePaths.map({ (filePath) -> NSURL in
    let expandedPath = filePath.stringByExpandingTildeInPath;
    return NSURL(fileURLWithPath: expandedPath, isDirectory: false)!
})

// Make movie assets from the URLs.
let movieAssets:[AVURLAsset] = urls.map { AVURLAsset(URL:$0, options:.None)! }

// Create the mutable composition that we are going to build up.
var composition = AVMutableComposition()

// Function to build the composition tracks.
func buildCompositionTracks(#composition: AVMutableComposition,
                     #transitionDuration: CMTime,

    return session
}

// Convert the file paths into URLS after expanding any tildes in the path
let urls = movieFilePaths.map({ (filePath) -> NSURL in
    let expandedPath = filePath.stringByExpandingTildeInPath;
    return NSURL(fileURLWithPath: expandedPath, isDirectory: false)!
})

// Make movie assets from the URLs.
let movieAssets:[AVURLAsset] = urls.map { AVURLAsset(URL:$0, options:.None)! }

// Create the mutable composition that we are going to build up.
var composition = AVMutableComposition()

// Now call the functions to do the preperation work for preparing a composition to export.
// First create the tracks needed for the composition.
buildCompositionTracks(composition: composition,
