Implement dynamic pair search for EM