simplify tree generation, restore broken autoscrolling (could use some tweaking)