update to sqrt by binsearch