added pointers and added root -999 for general tree structure