bug pixes, performance improvements
Added non buggy tree code
style changes