To calculate the modular inverse one uses the extended Euclidean algorithm. Normally, one can perform this in parallel but with some methods it works also afterwards.
Set $s_0 =1$ and $s_1 = 0$, and calculate $s_{i+1}= s_{i-1}- q_i s_i$ where $q_i$ are the quotients you found. Then $s_{k+1}$ is your modular inverse; where $k$ is such that the $k$-th reminder is the $\gcd$. See the linked to site for details.
So:
- $s_2 = 1 - 2 \cdot 0= 1$,
- $s_3 = 0 - 1 \cdot 1 = -1 $,
- $s_4 = 1 - 38 \cdot (-1)= 39$,
- $s_5 = -1 - 2 \cdot 39 = -79$
You are done! The modular inverse is (the class of) $-79$.
Note that the sequence of the $s_i$ so $1,0,1,-1, 39, -79$ is the exact same sequence and you performed the exact same computations that were performed in my other answer
The only difference is that here we did all the calculations for the right-hand side first; this is what you did, and then did (half) the computations for the left-hand side afterwards. I say "half", as we only computed the coefficient for the $5991$ not for $2014$. Though you could compute it in about the same way; see the calculation of the $t_i$ on the linked to page though it is really the same recursion as for the $s_i$, only the starting values are flipped, so $t_0 = 0$ and $t_1 = 1$.