reference issue is resolved and 
simple tree function is implemented