basic tree working