binary search tree finally works