fix consistency property of transformation matrix (equal rows length).
write down transformation matrix to csv file