make x_match slightly more efficient