Implementing multi thread search