added the transformmatrix function and makematrix kills a 0only row