Fix IO
Change binsearch to full search