updated a little for the general tree