finish direct target searching algorithm