Tree makeList() 
  {
    Tree myleft, myright;
    Tree tleft,tright;
    Tree retval = this;
    
    // head of left list
    if (left != null) 
      myleft = left.makeList();
    else
      myleft = null;

    // head of right list
    if (right != null)
      myright = right.makeList();
    else
      myright = null;

    if (myright != null) { 
      retval = myright; 
      right.next = this;
    }

    if (myleft != null) { 
      retval = myleft; 
      if (myright != null)
	left.next = myright;
      else
	left.next = this;
    }	
    next = null;
    
    return retval;
  }