added algorithm that reduces a matrix to row echalon form