fixed bounding boxes and some bugs. Added tree