Fixes #7. Introduced new functor like functionality to tree