add dense algo from trefethen