Simplify the determinant of a $4 \times 4$ matrix. I have to find the determinant of the following 4x4 matrix:
$\quad A=\begin{bmatrix}3&0&1&0\\0&2&0&0\\1&0&3&0\\0&0&0&-4\end{bmatrix}$
So I apply the Gaussian elimination to obtain an upper-triangle matrix:
$$det\begin{bmatrix}3&0&1&0\\0&2&0&0\\1&0&3&0\\0&0&0&-4\end{bmatrix}=\begin{vmatrix}3&0&1&0\\0&2&0&0\\1&0&3&0\\0&0&0&-4\end{vmatrix}\xrightarrow{3R_3-R_1}\begin{vmatrix}3&0&1&0\\0&2&0&0\\0&0&8&0\\0&0&0&-4\end{vmatrix}$$
Since I know from the solutions that the determinant is -64, I suppose that I need to simplify the third row in the reduced form to $\quad 0 \quad 0 \quad 2 \quad 0 \quad$ and then multiply the elements in the upper-left-to-bottom-right diagonal, which is indeed -64. But this doesn't make much sense since there's also a $-4$ that we can simplify. Can someone explain me the actual rules we need to follow?

Just expand by the first row:
\begin{align}
\begin{vmatrix}3&0&1&0 \\
0&2&0&0 \\
1&0&3&0 \\
0&0&0&-4
\end{vmatrix}&=
3\,\begin{vmatrix}
2&0&0 \\
0&3&0 \\
0&0&-4
\end{vmatrix}+
1\,\begin{vmatrix}
0&2&0 \\
1&0&0 \\
0&0&-4
\end{vmatrix}
=3(2\cdot3\cdot(-4))+1(-1)\begin{vmatrix}
2&0 \\
0&-4
\end{vmatrix}\\
&=-72+8=-64.
\end{align}
