       containerView.addSubview(cell)
     }
     
+    var selectedOriginalFrame: CGRect = .zero
+    if let selectedCell = copyCells.selectedCell {
+      selectedOriginalFrame = selectedCell.frame
+    }
+    
     //3. hide the current collection view
     fromVC.view.isHidden = true
     UIViewPropertyAnimator.runningPropertyAnimator(withDuration: duration,

          cell.frame = globalFrame
        }
        
        let instersection = finalFrame.intersection(cell.frame)
        var translateX = instersection.width+20
        if cell.frame.minX < selectedOriginalFrame.minX {
          translateX = -translateX
        }
        cell.transform = CGAffineTransform(translationX: translateX, y: 0)
      }

                                                    //5. We slide all other cells off the screen
                                                    for cell in copyCells.cells {
                                                      if cell != copyCells.selectedCell {
                                                        var translateX: CGFloat = 0
                                                        if cell.frame.minX < selectedOriginalFrame.minX {
                                                          translateX = -(cell.frame.maxX + 20)
                                                        } else {
                                                          translateX = finalFrame.width - (cell.frame.minX - 20)
                                                        }
                                                        cell.transform = CGAffineTransform(translationX: translateX, y: 0)
                                                      }
