updated cross searching algorithm