     private var pan: UIPanGestureRecognizer?
     
     private let backgroundView = UIView()
-    private let presentingViewSnapshotView = UIView()
     private let roundedViewForPresentingView = RoundedView()
     private let roundedViewForPresentedView = RoundedView()
+    
+    private let snapshotViewContainer = UIView()
+    private var snapshotView: UIView?
     
     private var snapshotViewTopConstraint: NSLayoutConstraint?
     private var snapshotViewWidthConstraint: NSLayoutConstraint?

        }
        
        backgroundView.removeFromSuperview()
        presentingViewSnapshotView.removeFromSuperview()
        roundedViewForPresentingView.removeFromSuperview()
        
        let offscreenFrame = CGRect(x: 0, y: containerView.bounds.height, width: containerView.bounds.width, height: containerView.bounds.height)

    /// then generates a new snapshot of the `presentingViewController`'s view,
    /// and then replaces the existing snapshot with it
    private func updateSnapshotView() {
        guard let currentSnapshotView = presentingViewController.view.snapshotView(afterScreenUpdates: true) else {
            return
        }
        
        snapshotView?.removeFromSuperview()
        
        currentSnapshotView.translatesAutoresizingMaskIntoConstraints = false
        snapshotViewContainer.addSubview(currentSnapshotView)
        NSLayoutConstraint.activate([
            currentSnapshotView.topAnchor.constraint(equalTo: snapshotViewContainer.topAnchor),
            currentSnapshotView.leftAnchor.constraint(equalTo: snapshotViewContainer.leftAnchor),
            currentSnapshotView.rightAnchor.constraint(equalTo: snapshotViewContainer.rightAnchor),
            currentSnapshotView.bottomAnchor.constraint(equalTo: snapshotViewContainer.bottomAnchor)
        ])
        
        snapshotView = currentSnapshotView
	}
	
    /// Thie method updates the aspect ratio and the height of the snapshot view
