modify haskell binsearch