fixed binary tree and add helpful function

add new methods and functions