Recursive search algorithm implemented