Changed binary search a bit