Further optimisations, changed the prototype of Tree.mli