How do I find the rank of a matrix using Gaussian elimination?