# Sample variance expression

In the formula for the sample variance below, I am confused as to how exactly do you go from the second line to the third line. ($\overline{X}$ denotes the sample mean). Could someone fill in the gap?

\begin{align} S^2& = \frac{1}{n-1} \sum_{i=1}^n(X_i - \bar{X} )^2 \\&= \frac{1}{n-1}\left( (X_1-\bar{X})^2+\sum_{i=2}^n(X_i - \bar{X} )^2 \right)\\ &= \frac{1}{n-1}\left( \left[\sum_{i=2}^n (X_i-\bar{X})\right]^2+\sum_{i=2}^n(X_i - \bar{X} )^2 \right)\\ \end{align}

since $\sum_{i=1}^n (X_i - \bar{X})=0$

Since $\sum_{i=1}^n (X_i - \bar{X}) = 0$
$$(X_1-\bar{X})+\sum_{i=2}^n (X_i - \bar{X}) = 0$$
$$-(X_1-\bar{X})=\sum_{i=2}^n (X_i - \bar{X})$$
$$(X_1-\bar{X})^2=\left( \sum_{i=2}^n (X_i - \bar{X})\right)^2$$