GaussElim[Matrix_]:=Module[{M=Matrix,i,j,k,r},
If[M[[1;;,1]] ≠  ConstantArray[0,Length[M]], 
Do[
Do[
If[i==j,
If[M[[i,j]]== 0,
Do[ If[r>i,
If[M[[r,j]]≠0, 
tempM = M[[i]];
M[[i]]= M[[r]];
M[[r]]= tempM;
Break[]
];
],
{r, Length[M]}
];
];
Do[If[i≠ k,
If[M[[i,j]]≠0,
M[[k]] = M[[i,j]] M[[k]] - M[[k,j]]M[[i]];
]
(*Print[M[[k]]];*)
],
{k, Length[M]}
];
],
{j, Length[M]}
],
{i, Length[M]}
]
];
M
]

GaussElim[{{3,2,-4,5},{5,-3,1,11},{5,-3,1,11},{5,-3,1,11}}]