exteded binary tree functions and started writing user functionality