Initialise Matrix M to to store all the factors
let M = new Array ( len1 ) ; for ( let i = 0 ; i < len1 ; i ++ ) { M [ i ] = new Array ( MAX ) ; for ( let j = 0 ; j < MAX ; j ++ ) { M [ i ] [ j ] = 0 ; } }