search algo improved