added embed function  for matrix to table