internally flatten all matrixes