implementing double matrix assign