simplified logic of matchToggle()