matrix M and coefficients B calculated