bincoeff := proc(n, bmess)
    local i, j, k, bk, pcoeff, poly;
    pcoeff := []:
    bk := linalg[vectdim](bmess);
    i := 0;
    k := 0;
    while i < bk do
        poly := 0:
        for j from 1 to n do
            poly := poly + bmess[i+j]*a^(j-1):
        od:
        pcoeff := [op(pcoeff), poly]:
        k := k+1;
        i := k*n;
    od:
    RETURN(evalm(pcoeff)):
end: