customized a dense matrix structure
tor_res works now
thx for ryx's help on debugging the cbuf
output matrix using treadp