Improving algorithm in greedyUpperTriangulation to find phi.

Adding steps to permutate rows as well as columns in an effort to find a phi matrix that is nonsingular.