some refactoring and code clean-up
improved toString method of Tree