Algebra rules when finding inverse modulo The idea is to find an inverse modulo for two numbers, $660$ and $43$ in this case. I find that the GCD is easy to calculate, but the step after that, calculating the inverse modulo when calculating back trough the GCD calculation.
The thing I do not get, is that 'by algebra' they keep removing certain numbers between parentheses, and it seems illogical to me.
$\begin{array}{rcl}660 & = & 43 \cdot 15 + 15 \\
    43 & = & 15 \cdot 2 + 13 \\
    15 & = & 13 \cdot 1 + 2 \\
    13 & = & 2 \cdot 6 + 1 \\
    2 & = & 1 \cdot 2 + 0
\end{array}$ 
Now, these are steps 1 trough 5, and for step 6 (to calculate the inverse), they give this:
$\begin{array}{rcl}
    (1) & = & 13 - 2 \cdot 6 \\
    (2) & = & 13 - (15 - 13) \cdot 6 \\
    (3) & = & 7 \cdot 13 - 6 \cdot 5 \\
    (4) & = & 7 \cdot (43 - 15 \cdot 2) - 6 \cdot 15 \\
    (5) & = & 7 \cdot 43 - 20 \cdot 15 \\
    (6) & = & 7 \cdot 43 − 20 \cdot (660 − 43 \cdot 15) \\
    (7) & = & 307 \cdot 43 - 20 \cdot 660
\end{array}$
The thing I do not get, for example, is how they end up with 20 at step 5. What exactly are the rules here when simplifying these steps? It seems like they are just replacing any numbers to their liking ..
I have this for my discrete math course, and have not had basic algebra lessons before this, so it could be really easy. All help is appreciated!
Edit: perhaps there is no real question above, my question thus: what are the rules for this? Can these integers within the parentheses just be shuffled around?

The way I like to describe the process is this:
When finding the GCD of two numbers, begin writing a table where the first row is the first number we are interested in, followed by a 1 followed by a 0.  The second row will be the second number we are interested in, followed by a 0 followed by a 1.
$$\begin{array}{c|c|c}660&1&0\\43&0&1\end{array}$$
Continue building the table by subtracting the largest multiple of the most recent row from the one before it that still results in a non-negative number for the first entry.  In this case $15$.  We have $[660,1,0]-15[43,0,1] = [15,1,-15]$ so our table continues as:
$$\begin{array}{c|c|c}660&1&0\\43&0&1\\15&1&-15\end{array}$$
Again, we look at how many copies of the last row can fit into the one previous, in this case twice: $[43,0,1]-2[15,1,-15]=[13,-2,31]$ so it continues
$$\begin{array}{c|c|c}660&1&0\\43&0&1\\15&1&-15\\13&-2&31\end{array}$$
This process continues until you eventually arrive at a zero for the first entry of a row.  The GCD is the first entry in the row previous.  Note also that these columns have significance.  The way I set it up, in finding $\gcd(A,B)$ the number on the left of a row is equal to the middle number times $A$ plus the right number times $B$.  In this example, $13 = -2\cdot 660 + 31\cdot 43$
Completing the table:
$$\begin{array}{c|c|c}660&1&0\\43&0&1\\15&1&-15\\13&-2&31\\
2&3&-46\\1&-20&307\\0\end{array}$$
This implies that $1=-20\cdot 660 + 307\cdot 43$, that $\gcd(660,43)=1$, and that $660^{-1}\equiv -20\pmod{43}$
