added variable M for fallback code