initial implementation of binary search routines