Add global matrix for storing result.