binarysearch done right, both iterative way and recursive way!