rewrite simpletree and add some features