make binSearch a tail-recursive method