changed Eigen array to matrix for linear algebra functions