updated Tree class