repeated printing of matrix in some cases, fixed.