Extended euclidean algorithm So I am trying to figure this out.
And for one of the problem the question is x*41= 1 (mod 99)
And the answer lists
 x | 41x mod 99
 0    99
 1    41
 -2   17
 5    7
 -12  3
 29   1

And conclude x=29
How did they get this value(can someone explain)? To better put, how do you calculate this?

When two numbers $e,\varphi$ are given, $e<\varphi$, $GCD(e,\varphi)=1$, and we need to find $x$, such that
$$
x\cdot e = 1 (\bmod~\varphi),\tag{1}
$$
then denote 
$$
r_0 = \varphi, \qquad v_0 = 0;
$$
$$
r_1 = e, \qquad\; v_1 = 1;
$$
then for each $n\geqslant 1$ to build values:
$$
s_n = \left\lfloor \frac{r_{n-1}}{r_n} \right\rfloor;
$$
$$
r_{n+1} = r_{n-1}-r_n s_n;
$$
$$
v_{n+1} = v_{n-1}-v_n s_n;
$$
and repeat it until $r_n=1$  $(r_{n+1}=0)$.
Last value $v_n$ (when $r_n=1$) will figure as solution of equation $(1)$.
It is comfortable to build appropriate table:
$$
\begin{array}{|c|c|r|r|}
\hline
n) & r_n & v_n & s_n & \color{gray}{check: ~~ e \cdot v_n \equiv r_n (\bmod~\varphi)} \\
\hline
0) & r_0 = \varphi = 99 & \mathbf{0} & - & - \\
1) & r_1 = e = 41 & 
\mathbf{1} & 
{\small\left\lfloor\frac{99}{41}\right\rfloor}= 2 &
\color{gray}{41\cdot 1 \equiv 41 (\bmod~99)} \\
2) & 17 & -2 & 
{\small\left\lfloor\frac{41}{17}\right\rfloor}= 2 &
\color{gray}{41\cdot (-2) = -84 \equiv 17 (\bmod~99)} \\
3) & 7  &  5 & 
{\small\left\lfloor\frac{17}{7}\right\rfloor}= 2 &
\color{gray}{41\cdot 5 = 205 \equiv 7 (\bmod~99)} \\
4) & 3 & -12 & 
{\small\left\lfloor\frac{7}{3}\right\rfloor}= 2 &
\color{gray}{41\cdot (-12) = -492 \equiv 3 (\bmod~99)} \\
5) & 1 & x=\underline{\underline{29}} &
{\small\left\lfloor\frac{3}{1}\right\rfloor}= 2 &
\color{gray}{41\cdot 29 = 1189 \equiv 1 (\bmod~99)} \\
\color{gray}{6)} & \color{gray}{0} &  & & \\
\hline
\end{array}
$$
