Refactored and fixed BSTsearch and binarySearch.