fix bug in binary search alghoritm. Half of data was ignored