make matching more flexible