docs: private int sampleFullConditional(int m, int n) {
  
          // remove z_i from the count variables
          int topic = z[m][n];
          word_topic_matrix[documents[m][n]][topic]--;
          nd[m][topic]--;
          nwsum[topic]--;
          ndsum[m]--;
  
          // do multinomial sampling via cumulative method:
          float[] p = new float[K];
          for (int k = 0; k < K; k++) {
              p[k] = (word_topic_matrix[documents[m][n]][k] + beta) / (nwsum[k] + V * beta)
                  * (nd[m][k] + alpha) / (ndsum[m] + K * alpha);
          }
          
          topic = drawFromProbability(p);
  
          // add newly estimated z_i to count variables
          word_topic_matrix[documents[m][n]][topic]++;
          nd[m][topic]++;
          nwsum[topic]++;
          ndsum[m]++;
  
          return topic;
      }