         ////////////////////////////////////////////////
         let renderSize = ExportedVideoSize
         let mainComposition = AVMutableVideoComposition(propertiesOfAsset: mixComposition)
-        mainComposition.instructions = [introInstruction, tienInstruction]
+        mainComposition.instructions = instructions
         mainComposition.frameDuration = CMTimeMake(1, 30)
         mainComposition.renderSize = renderSize
-        
         mainComposition.animationTool = AVVideoCompositionCoreAnimationTool(postProcessingAsVideoLayer: videoLayer, inLayer: parentLayer)
         ////////////////////////////////////////////////
         ////////////////////////////////////////////////

        videoLayer.frame = CGRect(origin: .zero, size: ExportedVideoSize)
        parentLayer.addSublayer(videoLayer)
        
        let (introInstruction, introEndTime) = addIntroScenceAtTime(atTime,
                                                                    parentLayer: parentLayer,
                                                                    composition: mixComposition,
                                                                    videoItemSize: videoItemSize)
        
        atTime = introEndTime
        
        ////////////////////////////////////////////////
        let (tienInstruction, tienEndTime) = addTienScenceAtTime(atTime,
                                                                 parentLayer: parentLayer,
                                                                 composition: mixComposition,
                                                                 videoItemSize: videoItemSize)
        atTime = tienEndTime
        ////////////////////////////////////////////////
        
        

// MARK: - Hard code

extension MergeVideosViewController {
    private func addVideoItemScenceAtTime(startTime: CMTime,
                                     parentLayer: CALayer,
                                     composition: AVMutableComposition,
                                     videoAsset: AVAsset,
                                     title: String,
                                     videoItemSize: CGSize) -> (AVMutableVideoCompositionInstruction, endTime: CMTime) {
        let randomSide = Int(arc4random()) % 2 == 0
        let startPoint = randomSide ? CGPoint(x: -parentLayer.bounds.width/2, y: parentLayer.bounds.height/2) : CGPoint(x: parentLayer.bounds.width*3/2, y: parentLayer.bounds.height/2)
        let endPoint = randomSide ? CGPoint(x: (parentLayer.bounds.width/2 - videoItemSize.width/2)/2 - 20,
                                            y: startPoint.y) : CGPoint(x: (parentLayer.bounds.width/2 + videoItemSize.width/2)/2 + 20, y: startPoint.y)
        
        let atTime = startTime
        let backgroundColor = UIColor(red: 102/255, green: 89/255, blue: 255/255, alpha: 1).CGColor
        
        let tienTitleTextLayer = CATextLayer()
        tienTitleTextLayer.string = title
        tienTitleTextLayer.font = font1
        tienTitleTextLayer.fontSize = 40
        tienTitleTextLayer.foregroundColor = UIColor(red: 232/255, green: 212/255, blue: 65/255, alpha: 1).CGColor
        tienTitleTextLayer.alignmentMode = kCAAlignmentRight
        tienTitleTextLayer.frame = CGRect(origin: .zero,
                                          size: CGSize(width: parentLayer.bounds.width/2 - videoItemSize.width/2, height: 50))
        tienTitleTextLayer.position = startPoint
        tienTitleTextLayer.opacity = 0.0
        parentLayer.addSublayer(tienTitleTextLayer)
        
