A compound of formula wherein: R 1 is alkyl of 1-6 carbon atoms, cycloalkyl of 3-6 carbon atoms, or heterocyclyl, all of which are optionally substituted with 1, 2, 3, or 4 substituents selected from halo, oxo, alkyl of 1-6 carbon atoms, cycloalkyl of 3-8 carbon atoms, heterocyclyl, phenyl, phenoxy, -CN, -O-R 6, -C -R 6, -OC -R 6, -C -O-R 6, - N(R 6)-C -O-R 7, -N(R 6)-C -R 7, -N(R 6)-C -N(R 6)(R 7), and - C -N(R 6)(R 7), wherein alkyl, cycloalkyl, heterocyclyl, phenyl, and phenoxy are optionally substituted by 1, 2, or 3 substituents selected from alkyl of 1-6 carbon atoms, cycloalkyl of 3-8 carbon atoms, alkoxy of 1-6 carbon atoms, hydroxyl, and halo; wherein R 6 and R 7 are independently selected from the group consisting of hydrogen, alkyl of 1-6 carbon atoms, and cycloalkyl or 3-8 carbon atoms; or R 6 and R 7 when taken together with the nitrogen to which they are attached form a heterocycle; R 2 is aryl, heteroaryl, or heterocyclyl, all of which are optionally substituted with 1, 2 or 3 substituents selected from alkyl of 1-6 carbon atoms, alkoxy of 1-6 carbon atoms, cycloalkyl of 3-8 carbon atoms, cycloalkylalkyl, aryl, arylalkyl, heteroaryl, heteroarylalkyl, heterocyclyl, heterocyclylalkyl, halo, haloalkoxy, oxo, -CN, -O-R 6, -O-C -R 6, -O-C -N(R 6)(R 7), -S-R 6, -N(R 6)(R 7), - S(=O)-R 6, -S(=O) 2 R 6, -S(=O) 2 -N(R 6)(R 7), -S(=O) 2 -O-R 6, -N(R 6)-C -R 7, - N(R 6)-C -O-R 7, -N(R 6)-C -N(R 6)(R 7), -C -R 6, -C -O-R 6, -C -N(R 6)(R 7), and -N(R 6)-S(=O) 2 -R 7, wherein the alkyl, alkoxy, cycloalkyl, aryl, heteroaryl or heterocyclyl is further optionally substituted with one or more substituents selected from halo, hydroxyl, oxo, -CN, and -O-R 6; with the proviso that the heteroaryl or heterocyclyl moiety includes at least one ring nitrogen atoms; R 4 and R 5 are independently hydrogen, halo, cyano, alkyl of 1-6 carbon atoms, alkoxy of 1-6 carbon atoms, or cycloalkyl of 3-6 carbon atoms, in which alkyl, alkoxy, and cycloalkyl are optionally substituted by hydroxyl, halo, or cycloalkyl of 3-8 carbon atoms; X 1 and X 5 are independently C(R 3) or N, in which each R 3 is independently hydrogen, halo, alkyl of 1-6 carbon atoms, alkoxy of 1-6 carbon atoms or cycloalkyl of 3-8 carbon atoms, wherein the alkyl or cycloalkyl is further optionally substituted with one or more substituents selected from halo, oxo, -CF 3, -O-CF 3, - N(R 6)(R 7), -C -R 6, -C -O-R 7, -C -N(R 6)(R 7), -CN, and -O-R 6; X 2, X 3 and X 4 are independently C(R 3), N, O, or S; with the proviso that at least one of X 2, X 3, and X 4 is C(R 3); and only one of X 2, X 3, and X 4 is O or S; or a pharmaceutically acceptable salt thereof. R 1 is alkyl of 1-6 carbon atoms, cycloalkyl of 3-6 carbon atoms, or heterocyclyl, all of which are optionally substituted with 1, 2, 3, or 4 substituents selected from halo, oxo, alkyl of 1-6 carbon atoms, cycloalkyl of 3-8 carbon atoms, heterocyclyl, phenyl, phenoxy, -CN, -O-R 6, -C -R 6, -OC -R 6, -C -O-R 6, - N(R 6)-C -O-R 7, -N(R 6)-C -R 7, -N(R 6)-C -N(R 6)(R 7), and - C -N(R 6)(R 7), wherein alkyl, cycloalkyl, heterocyclyl, phenyl, and phenoxy are optionally substituted by 1, 2, or 3 substituents selected from alkyl of 1-6 carbon atoms, cycloalkyl of 3-8 carbon atoms, alkoxy of 1-6 carbon atoms, hydroxyl, and halo; wherein R 6 and R 7 are independently selected from the group consisting of hydrogen, alkyl of 1-6 carbon atoms, and cycloalkyl or 3-8 carbon atoms; or R 6 and R 7 when taken together with the nitrogen to which they are attached form a heterocycle; R 2 is aryl, heteroaryl, or heterocyclyl, all of which are optionally substituted with 1, 2 or 3 substituents selected from alkyl of 1-6 carbon atoms, alkoxy of 1-6 carbon atoms, cycloalkyl of 3-8 carbon atoms, cycloalkylalkyl, aryl, arylalkyl, heteroaryl, heteroarylalkyl, heterocyclyl, heterocyclylalkyl, halo, haloalkoxy, oxo, -CN, -O-R 6, -O-C -R 6, -O-C -N(R 6)(R 7), -S-R 6, -N(R 6)(R 7), - S(=O)-R 6, -S(=O) 2 R 6, -S(=O) 2 -N(R 6)(R 7), -S(=O) 2 -O-R 6, -N(R 6)-C -R 7, - N(R 6)-C -O-R 7, -N(R 6)-C -N(R 6)(R 7), -C -R 6, -C -O-R 6, -C -N(R 6)(R 7), and -N(R 6)-S(=O) 2 -R 7, wherein the alkyl, alkoxy, cycloalkyl, aryl, heteroaryl or heterocyclyl is further optionally substituted with one or more substituents selected from halo, hydroxyl, oxo, -CN, and -O-R 6; with the proviso that the heteroaryl or heterocyclyl moiety includes at least one ring nitrogen atoms; R 4 and R 5 are independently hydrogen, halo, cyano, alkyl of 1-6 carbon atoms, alkoxy of 1-6 carbon atoms, or cycloalkyl of 3-6 carbon atoms, in which alkyl, alkoxy, and cycloalkyl are optionally substituted by hydroxyl, halo, or cycloalkyl of 3-8 carbon atoms; X 1 and X 5 are independently C(R 3) or N, in which each R 3 is independently hydrogen, halo, alkyl of 1-6 carbon atoms, alkoxy of 1-6 carbon atoms or cycloalkyl of 3-8 carbon atoms, wherein the alkyl or cycloalkyl is further optionally substituted with one or more substituents selected from halo, oxo, -CF 3, -O-CF 3, - N(R 6)(R 7), -C -R 6, -C -O-R 7, -C -N(R 6)(R 7), -CN, and -O-R 6; X 2, X 3 and X 4 are independently C(R 3), N, O, or S;