Index: src/tre/tre
===================================================================
--- src/tre/tre	(revision e7de6cc88c605c4f810cbc852e843294b4b0e8ac)
+++ src/tre/tre	(revision 3b02b04ff9c7c3446ca477cd84c2bc7f737c38b4)
@@ -156,5 +156,7 @@
   for t in trees
     $count += 1
-    t1=ground(t)
+    # t1=ground(t)
+
+    t1=t
 
     span = $FOREST ? " span:" + (ground_tree_min(t1).to_s + ","+ground_tree_max(t1).to_s)+";" : ""
@@ -170,5 +172,5 @@
     when /h/
       print "#\n# tree #{$count}\n# ------\n"
-      printtree(t1[0],t1[1],0)
+      printtree_dgp(t1[0],t1[1],0)
     end
   end
@@ -178,18 +180,19 @@
 def nodeinfo(id)
   info=""
+  gphid = $gphid[id]
   if $INFO =~ /o/
-    info += $ord1[id].to_s                           
+    info += $ord1[gphid].to_s + '/' + gphid.to_s + '/' + id.to_s
     info += '.' if $INFO =~ /[nfm]/
   end
   if $INFO =~ /n/
-    info += id.to_s                           
+    info += gphid.to_s                           
     info += '.' if $INFO =~ /[fm]/
   end
   if $INFO =~ /f/
-    info += $form[id] 
+    info += $form[gphid] 
     info += ';' if $INFO =~ /m/
   end
   if $INFO =~ /m/
-    info += $lem[id]  
+    info += $lem[gphid]  
   end
   info
@@ -215,4 +218,16 @@
     print "%-16s" % (arc[2]+": ")
     printtree(arc[1],arcs,o+1)
+  end
+end
+
+def printtree_dgp(root,arcs,o)
+  if o==0
+        print "%-16s" % "root: "
+  end
+  print nodeinfo(root),"\n"
+  for arc in arcs.select{ |a| a[0]==root }.sort{|a,b| a[1]<=>b[1] }
+    print "   "*(o+1)
+    print "%-16s" % (arc[2]+": ")
+    printtree_dgp(arc[1],arcs,o+1)
   end
 end
@@ -341,5 +356,5 @@
 def gentrees2 bos, eos
   $thetrees=[];
-  roots = (1...eos).select{|i| $vis.include? [i,eos]}.select{|i| $vis.include? [bos,i]}
+  roots = (bos..eos).select{|i| $vis.include? [i,eos]}.select{|i| $vis.include? [bos,i]}
 
   if $DEBUG then print "ROOTS: #{roots.inspect}\n" end
@@ -363,7 +378,8 @@
   if $DEBUG then print "buildR--#{min}--#{max}--#{tree.inspect}\n" end
   trees=[]
-  for a in $arcs.select{|a| a[0]==max && $vis.include?([min,a[1]]) }
-    if $DEBUG then print "ARC: #{a.inspect}\n" end
-    for r in buildR(a[4],a[3],tree+[a])                 #!!! buildR(a[1],a[3],tree+[a])
+  for arc in $arcs.select{|a| a[0]==max && $vis.include?([min,a[1]]) }
+    if $DEBUG then print "ARC: #{arc.inspect}\n" end
+    for r in buildR(arc[1],arc[0],tree+[arc])                 #!!! buildR(a[1],a[3],tree+[a])
+      # for r in buildR(arc[4],arc[3],tree+[arc])                 #!!! buildR(a[1],a[3],tree+[a])
       (rmin,rmax,rarcs) = r
       for l in buildR(min,rmin,rarcs)
@@ -395,5 +411,6 @@
   for arc in $arcs.select{|a| a[1]==max && $lhs.include?([min,a[0]]) }
     if $DEBUG then print "ARC: #{arc.inspect}\n" end
-    for r in buildR(arc[3],arc[4],tree+[arc]) ### buildR(arc[3],max,tree+[arc])
+     for r in buildR(arc[0],arc[1],tree+[arc]) ### buildR(arc[3],max,tree+[arc])
+     #for r in buildR(arc[3],arc[4],tree+[arc]) ### buildR(arc[3],max,tree+[arc])
       (rmin,rmax,rarcs) = r
       for l in buildL(min,rmin,rarcs)
