Activation Functions: Sigmoid, Tanh, ReLU

Imagine stacking ten layers of a neural network. But every layer only computes a weighted sum of its inputs. No matter how many layers you stack, the entire network collapses algebraically. It becomes a single linear map — a fancy way of computing Wx+bWx + b. All the depth, all the extra parameters, buy you nothing. They add nothing beyond what one layer could already do. This is the concrete problem that activation functions solve. They inject nonlinearity between layers. This way, depth actually increases what a network can represent. Activation functions are one of the smallest pieces of code in deep learning. Often they are a single line. Yet they shape almost everything about how a network trains. The choice between sigmoid, tanh, and ReLU matters greatly. It determines whether gradients vanish into numerical dust after a few layers. It determines whether units silently die and never fire again. It also determines whether a network trains in minutes or fails to converge at all. Every modern architecture, from convolutional networks to transformers, is built on some descendant of these three functions. This article treats activation functions as the bridge. They connect The Artificial Neuron and everything that comes after it. The The Multilayer Perceptron is exactly a chain of neurons. Its nonlinearities make stacking meaningful. The The Universal Approximation Theorem leans directly on the nonlinearity of the chosen activation. The The Vanishing and Exploding Gradient Problem is largely a story too. It is about which activation function you picked. It also depends on how its derivative behaves across many layers. By the end you will be able to write down each function and its derivative from memory. You will explain precisely why linear networks cannot gain expressive power from depth. You will trace a forward and backward pass numerically through a tiny network. You will also recognize the classic failure modes — saturation, dying units, and exploding pre-activations. Each activation is prone to one of these.

Key takeaways
  • A neural network without nonlinear activations collapses into a single linear transformation, regardless of depth.
  • Sigmoid squashes inputs to (0,1)(0,1); smooth and interpretable as a probability, but saturates and its gradient vanishes for large ∣x∣|x|.
  • Tanh squashes inputs to (−1,1)(-1,1), is zero-centered (helping optimization), but still saturates at the extremes.
  • ReLU outputs max⁡(0,x)\max(0,x): cheap, non-saturating for positive inputs, but can permanently "die" for negative inputs (zero gradient).
  • Each function's derivative is the key object: it multiplies into every upstream gradient during backpropagation, so its shape controls training dynamics.
  • Modern default: ReLU and its variants (Leaky ReLU, GELU, Swish) dominate hidden layers; sigmoid/tanh survive mainly at output layers and inside gates (e.g., LSTMs).
The core insight

Nonlinear activation functions are what let stacked layers compute more than a single linear map — and the shape of their derivative determines how well gradients survive backpropagation through depth.

The idea

An activation function ϕ:R→R\phi: \mathbb{R} \to \mathbb{R} is applied elementwise to the pre-activation z=w⊤x+bz = w^\top x + b produced by a neuron, giving the neuron's output a=ϕ(z)a = \phi(z). Without ϕ\phi (or with ϕ\phi the identity), a network of LL layers computes

a(L)=WL(WL−1(⋯(W1x+b1)⋯ )+bL−1)+bL,a^{(L)} = W_L(W_{L-1}(\cdots(W_1 x + b_1)\cdots) + b_{L-1}) + b_L,

which is an affine function of xx: expand the products and you get a(L)=W′x+b′a^{(L)} = W' x + b' for some single matrix W′W' and vector b′b'. Depth added zero expressive power. This is the precise reason nonlinearity is necessary, not merely conventional: composing linear maps yields a linear map, but composing nonlinear maps yields a much richer function class, which is the content later formalized by the The Universal Approximation Theorem. Three functions dominate the historical and practical landscape. Sigmoid (logistic function) σ(z)=11+e−z\sigma(z) = \frac{1}{1+e^{-z}} maps R→(0,1)\mathbb{R} \to (0,1) and was the original biologically-motivated choice, since it mimics a neuron's firing rate saturating at 0 or 1. Tanh tanh⁡(z)=ez−e−zez+e−z=2σ(2z)−1\tanh(z) = \frac{e^{z}-e^{-z}}{e^{z}+e^{-z}} = 2\sigma(2z)-1 maps R→(−1,1)\mathbb{R} \to (-1,1) and is simply a rescaled, shifted sigmoid — but the rescaling matters enormously because tanh is zero-centered while sigmoid is not. ReLU (Rectified Linear Unit) ReLU(z)=max⁡(0,z)\text{ReLU}(z) = \max(0,z) abandons smoothness and boundedness entirely in favor of computational simplicity and a derivative that does not shrink for positive inputs. The property that separates these functions in practice is saturation: a region where the function is nearly flat, so its derivative is near zero. Sigmoid and tanh saturate on both sides (z→±∞z \to \pm\infty); ReLU saturates only on the negative side (it is exactly zero, with zero gradient, for all z<0z < 0) and is unbounded and gradient-preserving on the positive side. This asymmetry is the single fact that explains most of the empirical differences between the three functions.

How it works

Step 1 — Compute the pre-activation. Each neuron computes z=w⊤x+bz = w^\top x + b, a linear combination of inputs (the mechanism already described in The Artificial Neuron).

Step 2 — Apply the nonlinearity elementwise. Choose ϕ∈{σ,tanh⁡,ReLU}\phi \in \{\sigma, \tanh, \text{ReLU}\} and compute a=ϕ(z)a = \phi(z). In a layer with many units, this is applied coordinate-wise to a vector.

Step 3 — Forward propagate. The output aa becomes the input to the next layer, repeating steps 1–2 across all layers — this is exactly the forward pass of a The Multilayer Perceptron.

Step 4 — Backpropagate through the nonlinearity. During training, the chain rule requires ϕ′(z)\phi'(z), the local derivative, at every unit. This value multiplies the upstream gradient flowing backward, so its magnitude directly controls how much gradient signal survives — this is the mechanism at the heart of the The Vanishing and Exploding Gradient Problem. The three derivatives, which you should be able to derive from the definitions:

σ′(z)=σ(z)(1−σ(z)),max⁡zσ′(z)=0.25 at z=0\sigma'(z) = \sigma(z)\bigl(1-\sigma(z)\bigr), \qquad \max_z \sigma'(z) = 0.25 \text{ at } z=0
tanh⁡′(z)=1−tanh⁡2(z),max⁡ztanh⁡′(z)=1 at z=0\tanh'(z) = 1 - \tanh^2(z), \qquad \max_z \tanh'(z) = 1 \text{ at } z=0
ReLU′(z)={1z>00z<0undefined (conventionally 0 or 1)z=0\text{ReLU}'(z) = \begin{cases} 1 & z > 0 \\ 0 & z < 0 \\ \text{undefined (conventionally } 0 \text{ or } 1\text{)} & z = 0\end{cases}

Sigmoid's derivative is derived from the quotient rule on σ(z)=(1+e−z)−1\sigma(z) = (1+e^{-z})^{-1}: σ′(z)=e−z(1+e−z)−2=σ(z)(1−σ(z))\sigma'(z) = e^{-z}(1+e^{-z})^{-2} = \sigma(z)(1-\sigma(z)), confirmed by substitution. Tanh's identity follows similarly from ddzez−e−zez+e−z\frac{d}{dz}\frac{e^z - e^{-z}}{e^z+e^{-z}} via the quotient rule, simplifying to 1−tanh⁡2(z)1-\tanh^2(z). ``` function FORWARD_LAYER(x, W, b, activation): z = W · x + b # pre-activation, vector of size n if activation == "sigmoid": a = 1 / (1 + exp(-z)) # elementwise else if activation == "tanh": a = (exp(z) - exp(-z)) / (exp(z) + exp(-z)) else if activation == "relu": a = max(0, z) # elementwise return a, z # cache z for the backward pass function BACKWARD_LAYER(dA, z, activation):

# dA: upstream gradient dL/dA, same shape as z if activation == "sigmoid": s = 1 / (1 + exp(-z)) dPhi = s (1 - s) else if activation == "tanh": t = (exp(z) - exp(-z)) / (exp(z) + exp(-z)) dPhi = 1 - t t else if activation == "relu": dPhi = (z > 0) ? 1 : 0 # subgradient convention at z = 0 dZ = dA * dPhi # elementwise product (chain rule) return dZ # pass on to compute dW, db, and dX ``` The pseudocode is deliberately structured to mirror real autodiff frameworks: `FORWARD_LAYER` caches zz because `BACKWARD_LAYER` needs it, and the backward step is always "multiply the incoming gradient by the local derivative," which is the elementary chain-rule step repeated at every layer during backpropagation.

Figure
Three activation functions: shape and saturation regions
z a 1.0 0.0 -1.0 sigmoid σ(z) tanh(z) ReLU(z) saturation region (|z| large): gradients → 0 ReLU: exactly zero gradient for z < 0 z = 0

Complexity & correctness

Time complexity. Each activation is applied elementwise, so for a layer with nn units the forward cost is O(n)O(n) evaluations of ϕ\phi, and the backward cost is O(n)O(n) evaluations of ϕ′\phi'. The constant factor differs meaningfully: sigmoid and tanh require an exponential e−ze^{-z} or e2ze^{2z} (a transcendental function, typically 10–20× the cost of a comparison), while ReLU requires only a comparison against zero, `max(0, z)`. Across a network with LL layers and total width N=∑ℓnℓN = \sum_\ell n_\ell, the total activation cost is O(N)O(N) per forward or backward pass — asymptotically the same order as the matrix multiplications (O(∑ℓnℓnℓ−1)O(\sum_\ell n_\ell n_{\ell-1})), but with ReLU's tiny constant it is usually negligible next to the matmuls, whereas sigmoid/tanh's exponential evaluations can be a measurable fraction of runtime on large, wide layers.

Space complexity. Backpropagation must cache the pre-activation zz (or equivalently aa, since ϕ′\phi' can often be written in terms of aa: σ′(z)=a(1−a)\sigma'(z) = a(1-a), tanh⁡′(z)=1−a2\tanh'(z) = 1-a^2) for every unit in every layer, since the backward pass needs it. This costs O(N)O(N) additional memory per example, matching the memory footprint of storing activations generally — it is not activation-specific overhead but a property of backpropagation itself.

Correctness of the derivative computations. The chain rule guarantees that if a=ϕ(z)a = \phi(z) and z=z(w)z = z(w), then ∂L∂z=∂L∂a⋅ϕ′(z)\frac{\partial L}{\partial z} = \frac{\partial L}{\partial a}\cdot \phi'(z), which is exactly the multiplication `dA * dPhi` in the pseudocode. The correctness of each closed-form derivative follows from ordinary single-variable calculus (quotient rule, as sketched above), and can be double-checked numerically: for any zz, ϕ(z+ϵ)−ϕ(z−ϵ)2ϵ→ϕ′(z)\frac{\phi(z+\epsilon) - \phi(z-\epsilon)}{2\epsilon} \to \phi'(z) as ϵ→0\epsilon \to 0 (central finite differences), which is the standard gradient-checking technique used to catch bugs in hand-derived backward passes.

Why nonlinearity is necessary — the collapse argument, formally. Suppose every layer uses ϕ=identity\phi = \text{identity}. Then layer ℓ\ell computes a(ℓ)=Wℓa(ℓ−1)+bℓa^{(\ell)} = W_\ell a^{(\ell-1)} + b_\ell. Substituting recursively:

a(L)=WL(WL−1(⋯(W1x+b1)⋯ )+bL−1)+bL=(∏ℓ=L1Wℓ)⏟W′x+b′a^{(L)} = W_L\bigl(W_{L-1}(\cdots (W_1 x + b_1)\cdots ) + b_{L-1}\bigr) + b_L = \underbrace{\left(\prod_{\ell=L}^{1} W_\ell\right)}_{W'} x + b'

for some vector b′b' built from the bℓb_\ell's and the WℓW_\ell's. Since W′W' is a single matrix and b′b' a single vector, the entire LL-layer network is exactly one affine map — no more expressive than a single-layer perceptron, regardless of how large LL or the hidden widths are. Any nonlinear, non-affine ϕ\phi breaks this collapse, since ϕ(Wx+b)\phi(Wx+b) is generically not affine in xx; this is the minimal condition the The Universal Approximation Theorem requires of an activation function.

Tradeoffs, stated honestly.

  • Sigmoid/tanh are smooth and bounded, giving stable, interpretable outputs, but ϕ′(z)→0\phi'(z) \to 0 as ∣z∣→∞|z| \to \infty means gradients shrink multiplicatively across layers — the core mechanism of vanishing gradients.
  • ReLU avoids saturation on the positive side (ϕ′=1\phi'=1 exactly, no shrinkage), which is why it trains deep networks far more reliably, but a unit with z<0z<0 forever (e.g., after a large negative weight update) has zero gradient forever and can "die," never updating again — an asymmetric failure mode sigmoid/tanh do not have in the same way.
  • ReLU is not differentiable at z=0z=0; frameworks sidestep this by defining a subgradient (0 or 1), which is mathematically imprecise but practically harmless since z=0z=0 has measure zero under continuous input distributions.

Worked example

Consider a single hidden unit with weight w=2w = 2, bias b=−1b = -1, receiving scalar input x=0.6x = 0.6, so the pre-activation is z=wx+b=2(0.6)−1=0.2z = w x + b = 2(0.6) - 1 = 0.2. We compute the forward output and the local derivative under each activation, then propagate an upstream gradient of δ=∂L∂a=0.5\delta = \frac{\partial L}{\partial a} = 0.5 (say, coming from a downstream loss) back to zz.

Activationa=ϕ(z)a = \phi(z) at z=0.2z=0.2ϕ′(z)\phi'(z) at z=0.2z=0.2dZ=δ⋅ϕ′(z)dZ = \delta \cdot \phi'(z)
Sigmoidσ(0.2)=11+e−0.2≈0.5498\sigma(0.2) = \frac{1}{1+e^{-0.2}} \approx 0.54980.5498(1−0.5498)≈0.24750.5498(1-0.5498) \approx 0.24750.5×0.2475≈0.12380.5 \times 0.2475 \approx 0.1238
Tanhtanh⁡(0.2)≈0.1974\tanh(0.2) \approx 0.19741−0.19742≈0.96101 - 0.1974^2 \approx 0.96100.5×0.9610≈0.48050.5 \times 0.9610 \approx 0.4805
ReLUmax⁡(0,0.2)=0.2\max(0, 0.2) = 0.211 (since z>0z>0)0.5×1=0.50.5 \times 1 = 0.5

Now push zz into the negative region by changing the input to x=−0.9x = -0.9, giving z=2(−0.9)−1=−2.8z = 2(-0.9) - 1 = -2.8:

Activationa=ϕ(z)a = \phi(z) at z=−2.8z=-2.8ϕ′(z)\phi'(z) at z=−2.8z=-2.8dZ=0.5⋅ϕ′(z)dZ = 0.5 \cdot \phi'(z)
Sigmoidσ(−2.8)≈0.0573\sigma(-2.8) \approx 0.05730.0573(0.9427)≈0.05400.0573(0.9427) \approx 0.0540≈0.0270\approx 0.0270
Tanhtanh⁡(−2.8)≈−0.9926\tanh(-2.8) \approx -0.99261−0.99262≈0.014751 - 0.9926^2 \approx 0.01475≈0.00738\approx 0.00738
ReLUmax⁡(0,−2.8)=0\max(0,-2.8) = 000 (since z<0z<0)00

This side-by-side trace makes the saturation phenomenon concrete: at z=0.2z=0.2 (near zero) all three gradients are of reasonable magnitude, but at z=−2.8z=-2.8 sigmoid and tanh gradients have shrunk to nearly nothing (0.054 and 0.0147 respectively), and ReLU's gradient is exactly zero — this unit is now "dead" for this input and contributes no learning signal at all through this path, illustrating both the vanishing-gradient behavior of the saturating functions and the dying-ReLU phenomenon in one worked comparison.

Figure
Forward and backward trace through one unit: two regimes
x w=2, b=−1 z φ(z) a z = 0.2 → ReLU gradient 1.0 (alive) z = −2.8 → ReLU gradient 0.0 (dead) backward: dZ = δ · φ'(z)

Common pitfalls & traps

PitfallWhy it happensConsequence
Using sigmoid/tanh in many stacked hidden layersGradients multiply ϕ′(z)≤0.25\phi'(z) \le 0.25 (sigmoid) or ≤1\le 1 (tanh) at every layerGradient magnitude decays geometrically with depth — the The Vanishing and Exploding Gradient Problem
Initializing weights too large with ReLULarge weights push many pre-activations deep negativeLarge fractions of units "die" permanently (zero gradient forever)
Forgetting sigmoid is not zero-centeredσ(z)∈(0,1)\sigma(z) \in (0,1), always positiveGradients w.r.t. weights in the next layer share the same sign, causing inefficient zig-zag optimization paths
Treating z=0z=0 as a real edge case for ReLUReLU is non-differentiable exactly at z=0z=0Frameworks silently pick a subgradient (0 or 1); rarely matters but can confuse gradient-check debugging
Assuming ReLU has no saturation at allOnly the positive side is unsaturatedNegative inputs are fully saturated (flat at 0, gradient exactly 0) — arguably a harsher saturation than sigmoid's asymptotic approach
Applying activation before batch/layer normalization inconsistentlyOrder matters for training dynamicsCommon source of subtly divergent-looking results between reimplementations

Pioneers & history

The mathematical shapes of sigmoid and tanh predate neural networks by over a century — the logistic function was studied by Pierre François Verhulst in the 1830s for population growth — but their adoption as neuron nonlinearities is tied to the perceptron and connectionist tradition. Frank Rosenblatt's perceptron (1958) used a hard threshold, not a smooth sigmoid; smooth, differentiable activations became essential once gradient-based training via backpropagation required a well-defined derivative everywhere. Sigmoid and tanh dominated neural network research through the 1980s and 1990s precisely because they are differentiable substitutes for the threshold units of earlier perceptron models.

Origins · 1 minGeoffrey Hinton and how this was discovered
GH
Geoffrey Hinton
born 1947 · Co-developer of backpropagation for multilayer networks and a central figure in the deep learning revival; his group's use of ReLU-style nonlinearities and dropout in the early 2010s helped make deep networks with many layers practically trainable.

history 1958 — Rosenblatt's perceptron uses a hard-threshold nonlinearity, the conceptual ancestor of later smooth activations. 1986 — Rumelhart, Hinton, and Williams popularize backpropagation, driving widespread use of differentiable sigmoid and tanh units. 2000 — Hahnloser, Sarpeshkar, Mahowald, Douglas, and Seung describe rectified linear-like dynamics in biological neural circuit models. 2010 — Nair and Hinton show ReLU improves training of restricted Boltzmann machines and deep networks over sigmoid/tanh units. 2012 — AlexNet uses ReLU throughout a deep convolutional network, contributing to a large ImageNet accuracy jump and cementing ReLU as the default hidden-layer nonlinearity.

Where this matters

Activation functions are not a historical footnote — they are a live design choice in every network trained today. Convolutional networks for image classification (ResNet, EfficientNet, and their descendants) use ReLU or its smoother relatives (Leaky ReLU, GELU, Swish) almost universally in hidden layers because non-saturating gradients let gradient signal survive tens or hundreds of layers. Recurrent architectures such as LSTMs and GRUs still rely heavily on sigmoid and tanh internally: sigmoid gates control what information to keep or forget (its (0,1)(0,1) range naturally represents a "how much" fraction), while tanh squashes candidate cell-state updates into a bounded, zero-centered range that keeps hidden states numerically stable across long sequences. Output layers for binary classification use sigmoid to produce a probability in (0,1)(0,1); multi-class classifiers generalize this with softmax, a multivariate sibling of sigmoid. Transformer architectures, the backbone of large language models, typically use GELU or Swish — smooth cousins of ReLU designed to keep ReLU's gradient-preserving benefits while avoiding its exact-zero dead zone. Any framework you use — PyTorch, TensorFlow, JAX — ships all three functions as primitive, hardware-accelerated operations, because they sit on the critical path of essentially every forward and backward pass executed in deep learning.

Ask the tutor: How does the choice between sigmoid, tanh, and ReLU concretely change what happens during backpropagation in a 50-layer network?

Why can't we just use a linear activation and add more layers instead?

Adding layers with linear (identity) activations does not increase expressive power, because the composition of affine maps is itself an affine map. Concretely, if layer ℓ\ell computes a(ℓ)=Wℓa(ℓ−1)+bℓa^{(\ell)} = W_\ell a^{(\ell-1)} + b_\ell, substituting recursively across LL layers yields a(L)=W′x+b′a^{(L)} = W'x + b' for a single combined matrix W′W' and vector b′b'. This means a 100-layer linear network computes exactly the same function class as a single-layer one — just with more parameters and more compute wasted getting there. Nonlinear activations break this collapse: ϕ(Wx+b)\phi(Wx+b) is not generally affine in xx, so composing many nonlinear layers can represent function classes a single layer cannot, which is the foundation of the The Universal Approximation Theorem.

Is ReLU always better than sigmoid or tanh?

Not universally — it depends on where the nonlinearity sits in the network. In hidden layers of deep feedforward or convolutional networks, ReLU usually trains faster and more reliably because its gradient does not shrink for positive pre-activations, avoiding much of the vanishing-gradient problem. But sigmoid and tanh remain the right choice in specific roles: sigmoid for output layers needing a (0,1)(0,1) probability, and sigmoid/tanh inside gated recurrent units (LSTM, GRU) where their bounded, saturating behavior is exactly what is needed to control information flow. The "always use ReLU" heuristic applies mainly to hidden layers of standard feedforward and convolutional stacks, not universally.

Why is sigmoid's lack of zero-centering considered a problem?

Because sigmoid outputs are always strictly positive (σ(z)∈(0,1)\sigma(z) \in (0,1)), the gradient of the loss with respect to the weights of the next layer, which depends on the sign of the incoming activation, tends to be all-positive or all-negative simultaneously for a given example. This forces gradient descent to take a zig-zagging path toward the optimum rather than moving directly, since weight updates cannot independently choose different sign directions. Tanh avoids this because its output range (−1,1)(-1,1) is centered at zero, allowing both positive and negative activations and thus more balanced gradient directions — one reason tanh often outperforms sigmoid in hidden layers even though both saturate similarly.

What exactly is the derivative of ReLU at z = 0, and does it matter in practice?

Mathematically, ReLU(z)=max⁡(0,z)\text{ReLU}(z) = \max(0,z) has a sharp corner at z=0z=0, so the derivative is undefined there in the strict calculus sense — the left derivative is 0 and the right derivative is 1. In practice, deep learning frameworks adopt a convention (commonly setting the derivative to 0 or 1 at exactly z=0z=0) since this single point has probability zero of being hit exactly under continuous-valued inputs and floating-point arithmetic. This is a subgradient choice rather than a true derivative, and it causes no measurable harm in practice, though it is worth knowing when debugging gradient checks that seem to disagree at isolated points.

How do vanishing gradients connect specifically to the choice of activation function?

During backpropagation, the gradient at any layer is the upstream gradient multiplied by the local derivative ϕ′(z)\phi'(z) at every unit, chained across all layers back to the input. If ϕ′(z)≤c<1\phi'(z) \le c < 1 for some constant cc at every layer (true for sigmoid, where c=0.25c=0.25, and tanh, where c=1c=1 but is rarely achieved exactly), the product across LL layers scales roughly like cLc^L, shrinking exponentially with depth. This is precisely the mechanism behind the The Vanishing and Exploding Gradient Problem, and it is why non-saturating activations like ReLU, whose derivative is exactly 1 (not less than 1) for all positive pre-activations, dramatically improve trainability of very deep networks.

Why does the exact numeric formula for tanh relate so closely to sigmoid?

Algebraically, tanh⁡(z)=2σ(2z)−1\tanh(z) = 2\sigma(2z) - 1, which you can verify by substituting the definition of σ\sigma and simplifying the exponentials. This means tanh is literally a rescaled and shifted sigmoid: it stretches sigmoid's output range from (0,1)(0,1) to (−1,1)(-1,1) and compresses the input by evaluating sigmoid at 2z2z instead of zz. Despite being mathematically equivalent up to an affine transform, tanh's zero-centering changes optimization dynamics enough that the two functions behave quite differently as hidden-layer activations, illustrating that seemingly small transformations of an activation function can have outsized practical consequences.

Do modern architectures still use sigmoid and tanh at all, or has ReLU fully replaced them?

Both are still very much in use, just in more specialized roles rather than as the default hidden-layer choice in feedforward and convolutional networks. LSTM and GRU recurrent units rely on sigmoid gates to control read/write/forget behavior (values naturally interpreted as fractions between 0 and 1) and tanh for producing bounded candidate updates to the cell state. Sigmoid remains standard for binary classification output layers, and its multivariate generalization, softmax, is standard for multi-class classification outputs. ReLU and its smoother relatives (Leaky ReLU, GELU, Swish) dominate hidden layers of feedforward, convolutional, and transformer architectures, but the older functions persist wherever a bounded, saturating output is the actual desired behavior rather than a limitation to avoid.

Before this

Where this leads