Produces a valid decomposition of a matrix; however, the U matrix is not upper triangular if the rows do not naturally fall in order (i.e. the P matrix is not the identity matrix); will try to accomodate this.