code: function setRightThread(wt, i, sr, modsumsr) {
      var ri = wt.children[i].er;
      ri.tr = sr;
      var diff = (modsumsr - sr.mod) - wt.children[i].mser;
      ri.mod += diff; 
      ri.prelim -= diff;
      wt.children[i].er = wt.children[i - 1].er; 
      wt.children[i].mser = wt.children[i - 1].mser;
    }
docs: Symmetrical to setLeftThread.