You would need a `Math.Min(TargetLocation.X, fromLimit)` integrated somewhere above, too.