change all the rebalance code to be macros
small fix in tree find
some small fixes
add logger