fixed binary search tree implementation