fixed dimensions of matrix in matrix.py