Finished filling the matrix values. There is probably room for improvement in terms of efficiency, mainly in terms of reducing the number of times the same data is transported to different places. Need to employ a proper RREF function that can handle rectangular matrices, and make an algorithm that decides what to do with the results and acts accordingly.