binary search (scala)