Try to use sparse matrix.