left and right recursive search