a tiny binary search algorithm in ruby