binary search in ruby