A compound of the formula I: wherein: X is N or CH; R 1 is selected from the group consisting of: hydrogen, halogen, -CN, -C 1-6 alkyl, which is unsubstituted or substituted with a hydroxy, or 1-3 fluoro, -O-C 1-6 alkyl, which is unsubstituted or substituted with a hydroxy, or 1-3 fluoro, -C≡CH, -(C=O)-NH 2, and -(C=O)-NH(-C 1-6 alkyl); R 2 is selected from the group consisting of: hydrogen, halogen, -C 1-6 alkyl, and -NH 2, or R 1 and R 2 are joined together with a -(CH 2) 3 - or -(C=O)(CH 2) 2 - to form a 5-membered ring, which is unsubstituted or substituted with a hydroxy, or 1-3 fluoro, or R 1 and R 2 are joined together with a -(CH 2) 4 -, -(C=O)(CH 2) 3 -, or-(CH 2)(C=O)(CH 2) 2 - to form a 6-membered ring, which is unsubstituted or substituted with a hydroxy, or 1-3 fluoro; R 3 is selected from the group consisting of: hydrogen, halogen, -CN, -C 1-6 alkyl, and -NH 2; R 4 is selected from the group consisting of: hydrogen, -CN, chloro, and fluoro; R 5 is selected from the group consisting of: hydrogen, and -CH 3; R 6 is selected from the group consisting of: hydrogen, -C 1-6 alkyl, which is unsubstituted or substituted with a -CN, 1-3 fluoro, or phenyl which is unsubstituted or substituted with a hydroxy or a -SO 2 -NH 2, -C 3-6 cycloalkyl, which is unsubstituted or substituted with a -CN, or -(C=O)-NH 2; -(CH 2-5 cycloalkyl-O-), -C 1-6 alkyl-C 3-6 cycloalkyl, -C 1-6 alkyl-(CH 2-5 cycloalkyl-O-), -C 1-6 alkyl-O-C 1-6 alkyl, -C 1-6 alkyl-C≡CH, -C 1-6 alkyl-C≡C-C 1-6 alkyl, and phenyl; each of R 7 and R 8 is independently selected from the group consisting of: hydrogen, and C 1-6 alkyl, or R 7 and R 8 taken together form a keto group; or a pharmaceutically acceptable salt thereof. X is N or CH; R 1 is selected from the group consisting of: hydrogen, halogen, -CN, -C 1-6 alkyl, which is unsubstituted or substituted with a hydroxy, or 1-3 fluoro, -O-C 1-6 alkyl, which is unsubstituted or substituted with a hydroxy, or 1-3 fluoro, -C≡CH, -(C=O)-NH 2, and -(C=O)-NH(-C 1-6 alkyl); hydrogen, halogen, -CN, -C 1-6 alkyl, which is unsubstituted or substituted with a hydroxy, or 1-3 fluoro, -O-C 1-6 alkyl, which is unsubstituted or substituted with a hydroxy, or 1-3 fluoro, -C≡CH, -(C=O)-NH 2, and -(C=O)-NH(-C 1-6 alkyl); R 2 is selected from the group consisting of: hydrogen, halogen, -C 1-6 alkyl, and -NH 2, or R 1 and R 2 are joined together with a -(CH 2) 3 - or -(C=O)(CH 2) 2 - to form a 5-membered ring, which is unsubstituted or substituted with a hydroxy, or 1-3 fluoro, or R 1 and R 2 are joined together with a -(CH 2) 4 -, -(C=O)(CH 2) 3 -, or-(CH 2)(C=O)(CH 2) 2 - to form a 6-membered ring, which is unsubstituted or substituted with a hydroxy, or 1-3 fluoro; hydrogen, halogen, -C 1-6 alkyl, and -NH 2, R 3 is selected from the group consisting of: hydrogen, halogen, -CN, -C 1-6 alkyl, and -NH 2; hydrogen, halogen, -CN, -C 1-6 alkyl, and -NH 2; R 4 is selected from the group consisting of: hydrogen, -CN, chloro, and fluoro; hydrogen, -CN, chloro, and fluoro; R 5 is selected from the group consisting of: hydrogen, and -CH 3; hydrogen, and -CH 3; R 6 is selected from the group consisting of: hydrogen, -C 1-6 alkyl, which is unsubstituted or substituted with a -CN, 1-3 fluoro, or phenyl which is unsubstituted or substituted with a hydroxy or a -SO 2 -NH 2, -C 3-6 cycloalkyl, which is unsubstituted or substituted with a -CN, or -(C=O)-NH 2; -(CH 2-5 cycloalkyl-O-), -C 1-6 alkyl-C 3-6 cycloalkyl, -C 1-6 alkyl-(CH 2-5 cycloalkyl-O-), -C 1-6 alkyl-O-C 1-6 alkyl, -C 1-6 alkyl-C≡CH, -C 1-6 alkyl-C≡C-C 1-6 alkyl, and phenyl; hydrogen, -C 1-6 alkyl, which is unsubstituted or substituted with a -CN, 1-3 fluoro, or phenyl which is unsubstituted or substituted with a hydroxy or a -SO 2 -NH 2, -C 3-6 cycloalkyl, which is unsubstituted or substituted with a -CN, or -(C=O)-NH 2; -(CH 2-5 cycloalkyl-O-), -C 1-6 alkyl-C 3-6 cycloalkyl, -C 1-6 alkyl-(CH 2-5 cycloalkyl-O-), -C 1-6 alkyl-O-C 1-6 alkyl, -C 1-6 alkyl-C≡CH, -C 1-6 alkyl-C≡C-C 1-6 alkyl, and phenyl; each of R 7 and R 8 is independently selected from the group consisting of: hydrogen, and C 1-6 alkyl, or R 7 and R 8 taken together form a keto group; hydrogen, and C 1-6 alkyl,