I am stuck here. The submatrix phi keeps coming out as a matrix of zeros. It must be nonsingular to continue with the algorithm.