-extern ScalingFunction<KBPK> ScaleKBPK, ScaleKKBP; // KBP vs K
-extern ScalingFunction<KQKRP> ScaleKQKRP, ScaleKRPKQ; // KQ vs KRP
-extern ScalingFunction<KRPKR> ScaleKRPKR, ScaleKRKRP; // KRP vs KR
-extern ScalingFunction<KRPPKRP> ScaleKRPPKRP, ScaleKRPKRPP; // KRPP vs KRP
-extern ScalingFunction<KPsK> ScaleKPsK, ScaleKKPs; // King and pawns vs king
-extern ScalingFunction<KBPKB> ScaleKBPKB, ScaleKBKBP; // KBP vs KB
-extern ScalingFunction<KBPPKB> ScaleKBPPKB, ScaleKBKBPP; // KBPP vs KB
-extern ScalingFunction<KBPKN> ScaleKBPKN, ScaleKNKBP; // KBP vs KN
-extern ScalingFunction<KNPK> ScaleKNPK, ScaleKKNP; // KNP vs K
-extern ScalingFunction<KPKP> ScaleKPKPw, ScaleKPKPb; // KP vs KP
+ template<EndgameCode E, typename T = eg_type<E>>
+ void add(const std::string& code) {