Finally debugged everything, it all works now. (MINUS the tree)