protected Look (VorbisStream source, Mode mode) {
         int dim=0, acc=0, maxstage=0;

         map=mode.getMapping();
         parts=Residue.this.getClassifications();
         fullbooks=source.getSetupHeader().getCodeBooks();
         phrasebook=fullbooks[Residue.this.getClassBook()];
         dim=phrasebook.getDimensions();

         partbooks=new int[parts][];

         for(int j=0;j<parts;j++) {
            int stages=Util.ilog(Residue.this.getCascade()[j]);
            if(stages!=0) {
               if(stages>maxstage) {
                  maxstage=stages;
               }
               partbooks[j]=new int[stages];
               for(int k=0; k<stages; k++){
                  if((Residue.this.getCascade()[j]&(1<<k))!=0){
                     partbooks[j][k]=Residue.this.getBooks()[j][k];
                  }
	            }
            }
         }

         partvals=(int)Math.rint(Math.pow(parts, dim));
         stages=maxstage;

         decodemap=new int[partvals][];

         for(int j=0;j<partvals;j++){
            int val=j;
            int mult=partvals/parts;
            decodemap[j]=new int[dim];

            for(int k=0;k<dim;k++){
               int deco=val/mult;
               val-=deco*mult;
               mult/=parts;
               decodemap[j][k]=deco;
            }
         }
      }