made changes to binary tree to make it working.