     }
     
     // Make sure that the bubble doesn't leave the boundaries of the view
-    let arrowPosition = CGPoint(
+    var arrowPosition = CGPoint(
       x: from.origin.x + from.width / 2 - frame.origin.x,
       y: (direction == .up) ? frame.height : from.origin.y + from.height - frame.origin.y + offset
     )

    frame.origin.x += bubbleOffset
    frame.size = CGSize(width: frame.width + borderWidth * 2, height: frame.height + borderWidth * 2)
    
    return (frame, arrowPosition)
  }
  

    if y < 0 { y = edgeMargin }
    // Make sure we stay in the view limits except if it has scroll then it must be inside contentview limits not the view
    if let containerScrollView = containerView as? UIScrollView {
      if y + frame.height > containerScrollView.contentSize.height {
        y = containerScrollView.contentSize.height - frame.height - edgeMargin
      }
    } else {
      if y + frame.height > containerView.bounds.height && constrainInContainerView {
        y = containerView.bounds.height - frame.height - edgeMargin
      }
    }
    frame.origin = CGPoint(x: x, y: y)
    
