add dense matrix implementation