Added basic tree functionality