Add the matrix of variables

The matrix is used to avoid duplication of variables.