binary search fix, most to do functionality finished