Commented the binary search and fixed bug stackoverflow