Tree implementation almost done