- a spaghetti code about tree implementation
TODO: to be fixed