A compound of the formula wherein: ring A is R 1 is hydrogen, C 1-10 alkyl or C 3-10 cycloalkyl which is optionally substituted with 1-3 C 1-10 alkyl, each R 1 or it's substituent is optionally halogenated; R 2 is C 1-6 alkyl, C 3-7 cycloalkyl, 1,1-dioxo-1λ 6 -thiomorpholinylcarbonyl, phenylsulfonyl, tetrahydropyranyl, tetrahydrofuranyl, pyrrolidinyl or piperidinyl, each optionally independently substituted with 1 to 3 substituents chosen from C 1-5 alkyl, C 3-7 cycloalkyl, C 1-5 alkoxy, C 1-5 alkylthio, C 1-5 alkylsulfonyl, C 1-5 alkoxycarbonyl, C 1-5 alkylamino, C 3-6 cycloalkylamino, C 1-5 dialkylamino, C 1-5 alkylaminocarbonyl, C 1-5 acylamino, C 1-5 dialkylaminocarbonyl, hydroxyl, halogen, cyano, nitro, oxo, phenyl and heterocyclyl chosen from tetrahydropyranyl, dioxanyl, tetrahydrofuranyl, thiomorpholinyl, 1,1-dioxo-1λ 6 -thiomorpholinyl, morpholinyl, pyrrolidinyl, piperidinyl and piperazinyl, each R 2 substituent where possible is optionally halogenated or substituted with 1 to 3 C 1-5 alkyl, C 1-5 acyl, methyl sulfonyl, cyano, phenyl, oxo or hydroxyl; or R 1 and R 2 together with the nitrogen atom to which they are attached form a ring chosen from thiomorpholinyl, 1,1-dioxo-1λ 6 -thiomorpholinyl, morpholinyl, pyrrolidinyl, piperidinyl, piperazinyl, azetidinyl, benzimidazolyl, pyrazolyl, imidazolyl, triazinyl, indazolyl, indolyl, indolinyl, isoindolyl, isoindolinyl, and 2-aza-spiro[4.5]dec-2-yl, 1-aza-spiro[4.5]dec-1-yl, 1-azaspiro[4.4]non-1-yl, 2-aza-spiro[4.4]non-2-yl, 2-aza-spiro[5.5]undec-2-yl, 1-aza-spiro[5.5]undec-1-yl, each optionally substituted with 1 to 3 C 1-6 alkyl, C 1-6 alkoxy, C 1-6 acyl, C 1-6 alkyl sulfonyl, cyano, phenyl, oxo, hydroxyl and halogen each ring substituent being further optionally halogenated where possible; R 3 and R 3' are each methyl or ethyl, each optionally halogenated, or R 3 and R 4 together with the carbon atom to which they are attached form a cyclopropyl or cyclobutyl ring each optionally halogenated. R 4 is hydrogen or methyl; R 5 is chosen from and m is 0, 1, 2 or 3; R 6 is hydrogen, C 1-4 alkyl or C 1-4 alkoxy; R 7 and R 8 are each independently hydrogen, or C 1-4 alkyl with the proviso that both R 7 and R 8 cannot be hydrogen; and wherein R 7 and R 8 optionally can cyclize to form a C 3-7 cycloalkyl ring; R 9 is C 1-6 alkyl or aryl; ring B is a 5-6 membered heterocyclic ring; n is 0, 1 or 2; wherein any carbon atom on the formula or any R substituent listed above is optionally partially or fully halogenated where possible; or a pharmaceutically acceptable salt thereof. ring A is R 1 is hydrogen, C 1-10 alkyl or C 3-10 cycloalkyl which is optionally substituted with 1-3 C 1-10 alkyl, each R 1 or it's substituent is optionally halogenated; R 2 is C 1-6 alkyl, C 3-7 cycloalkyl, 1,1-dioxo-1λ 6 -thiomorpholinylcarbonyl, phenylsulfonyl, tetrahydropyranyl, tetrahydrofuranyl, pyrrolidinyl or piperidinyl, each optionally independently substituted with 1 to 3 substituents chosen from C 1-5 alkyl, C 3-7 cycloalkyl, C 1-5 alkoxy, C 1-5 alkylthio, C 1-5 alkylsulfonyl, C 1-5 alkoxycarbonyl, C 1-5 alkylamino, C 3-6 cycloalkylamino, C 1-5 dialkylamino, C 1-5 alkylaminocarbonyl, C 1-5 acylamino, C 1-5 dialkylaminocarbonyl, hydroxyl, halogen, cyano, nitro, oxo, phenyl and heterocyclyl chosen from tetrahydropyranyl, dioxanyl, tetrahydrofuranyl, thiomorpholinyl, 1,1-dioxo-1λ 6 -thiomorpholinyl, morpholinyl, pyrrolidinyl, piperidinyl and piperazinyl, each R 2 substituent where possible is optionally halogenated or substituted with 1 to 3 C 1-5 alkyl, C 1-5 acyl, methyl sulfonyl, cyano, phenyl, oxo or hydroxyl; or R 1 and R 2 together with the nitrogen atom to which they are attached form a ring chosen from thiomorpholinyl, 1,1-dioxo-1λ 6 -thiomorpholinyl, morpholinyl, pyrrolidinyl, piperidinyl, piperazinyl, azetidinyl, benzimidazolyl, pyrazolyl, imidazolyl, triazinyl, indazolyl, indolyl, indolinyl, isoindolyl, isoindolinyl, and 2-aza-spiro[4.5]dec-2-yl, 1-aza-spiro[4.5]dec-1-yl, 1-azaspiro[4.4]non-1-yl, 2-aza-spiro[4.4]non-2-yl, 2-aza-spiro[5.5]undec-2-yl, 1-aza-spiro[5.5]undec-1-yl, each optionally substituted with 1 to 3 C 1-6 alkyl, C 1-6 alkoxy, C 1-6 acyl, C 1-6 alkyl sulfonyl, cyano, phenyl, oxo, hydroxyl and halogen each ring substituent being further optionally halogenated where possible; R 3 and R 3' are each methyl or ethyl, each optionally halogenated, or R 3 and R 4 together with the carbon atom to which they are attached form a cyclopropyl or cyclobutyl ring each optionally halogenated. R 4 is hydrogen or methyl; R 5 is chosen from and m is 0, 1, 2 or 3; R 6 is hydrogen, C 1-4 alkyl or C 1-4 alkoxy; R 7 and R 8 are each independently hydrogen, or C 1-4 alkyl with the proviso that both R 7 and R 8 cannot be hydrogen; and wherein R 7 and R 8 optionally can cyclize to form a C 3-7 cycloalkyl ring; R 9 is C 1-6 alkyl or aryl; ring B is a 5-6 membered heterocyclic ring; n is 0, 1 or 2;