using matrix package