fix binary search http://googleresearch.blogspot.de/2006/06/extra-extra-read-all-about-it-nearly.html