How has the author obtained Riemann-Stieltjes sum of $g$ wrt $f$ as $f(b)g(b) - f(a)g(a) - \sum_{k=1}^{2n} f(x_i) [g(y_k) - g(y_{k-1})]$ In the book of The elements of Real Analysis by Bartle, at page 232, it is given that

[...] 
Let $J = [a,b]$, and $P$ be a partition of $J$. Define $$S(P; f,
 g) = \sum_{k=1}^n g(e_k) [f(x_k)- f(x_{k-1})],$$ where $x_{k-1} \leq
 e_k \leq x_k$, and $x_i$s are the end points of $P$. Let $Q= (y_0,
 y_1, ..., y_{2n})$ be partition of $J$ obtained by using both $e_k$
  and $x_k$ as partition points; hence $x_{2k} = x_k$ and $y_{2k-1} =
 e_k$. Add and substract the terms $f(x_{2k}) g(x_{2k})$, $k=0,...,n$
  to $S(P; f, g)$, and rearrange to obtaion $$S(P; g, f) = f(b)g(b) -
 f(a)g(a) - \sum_{k=1}^{2n} f(x_i) [g(y_k) - g(y_{k-1})],$$ [...]
we get  $$\int_a^b f dg + \int_a^b gdf = f(b)g(b) - f(a)g(a)$$

My question is that how the author did obtain
$$f(b)g(b) -
 f(a)g(a) - \sum_{k=1}^{2n} f(x_i) [g(y_k) - g(y_{k-1})]$$ from adding the terms $f(x_{2k}) g(x_{2k})$, $k=0,...,n$ to $$\sum_{k=1}^n g(e_k) [f(x_k)- f(x_{k-1})].$$
 A: As a telescoping sum, we have
$$f(b)g(b) - f(a)g(a) = \sum_{k=1}^n[f(x_k)g(x_k) - f(x_{k-1})g(x_{k-1})] \\ = \sum_{k=1}^ng(x_k)f(x_k) - \sum_{k=1}^ng(x_{k-1})f(x_{k-1}). $$
Hence,
$$\tag{1}S(P;f,g) - \left[f(b)g(b) - f(a) g(a) \right] \\= \sum_{k=1}^n g(e_k)[f(x_k) - f(x_{k-1}) - \sum_{k=1}^ng(x_k)f(x_k) + \sum_{k=1}^ng(x_{k-1})f(x_{k-1}) \\ =  -\left(\sum_{k=1}^nf(x_{k-1})[g(e_k) - g(x_{k-1})] +  \sum_{k=1}^nf(x_{k})[g(x_k) - g(e_{k})] \right) $$
Subsituting with $x_k = y_{2k}$, $x_{k-1} = y_{2k-2}$ and  $e_k = y_{2k-1}$ in the last line of (1) we obtain
$$\tag{2}S(P;f,g) - \left[f(b)g(b) - f(a) g(a) \right] \\=-\left(\sum_{k=1}^nf(y_{2k-2})[g(y_{2k-1}) - g(y_{2k-2})] +  \sum_{k=1}^nf(y_{2k})[g(y_{2k}) - g(y_{2k-1})] \right)$$
Define special "intermediate points" $\xi_{2k-1} = y_{2k-2}$ and $\xi_{2k} = y_{2k}$. Substituting into (2) we obtain
$$\tag{3}S(P;f,g) - \left[f(b)g(b) - f(a) g(a) \right] \\=-\left(\sum_{k=1}^nf(\xi_{2k-1})[g(y_{2k-1}) - g(y_{2k-2})] +  \sum_{k=1}^nf(\xi_{2k})[g(y_{2k}) - g(y_{2k-1})] \right)$$
Taking $j = 2k$, equation (3) is equivalent to
$$S(P;f,g) = f(b)g(b) - f(a) g(a)    -\sum_{j=1}^{2n} f(\xi_j)[g(y_j) - g(y_{j-1})]$$
The sum on the RHS is a Riemann-Stieltjes sum of $f$ with respect to $g$ over $[a,b]$.  
Note that Bartle has been a little vague in using the notation $x_i$ where I use $\xi_j$, defined precisely above. 
