Modified for "smart" search instead of binary search

Unfortunately, it's less efficient, but it's better for the user.