binary search sorted array for lowest instance of a var