updated bitmatrix with seperate poly and primematrix