working version of matprod_trans2