Basic Linear Algebra question

find a solution to the system:

5a1 + 2a2 - 3a3 = 4

a1 - a2 + 2a3 = -1

Solution:

we can eliminate a1 from the second row by using R1 - 5R2 -> R2, which

gives:

5a1 - 2a2 - 3a3 = 4

7a2 - 13a3 = 9

from the second equation we obtain:

a2 = 1/7 (9+13a3)

We substitute this expression in the first equation and solve for a1 in

terms of a3. We find that

a1 = 2/7 - 1/7 a3

....................

I can understand everything up to this point. However I cannot see how this has been substituted or how one can do this. Can anyone illustrate precisely what has happened in the last step?

Many thanks

Biter