Binary Search in Erlang