A compound represented by the following structural formula: or a pharmaceutically acceptable salt thereof, wherein: X is N or CR c; R 1 is alkyl or -NR a R b; R 2 is H; halogen; -CN; -NRC R; -C OR; -C NR a R b; monocyclic heteroaromatic optionally substituted with one or more groups selected from alkyl, -CN, -NRC R,-C OR, -C NR a R b and halogen; monocyclic non-aromatic heterocycle optionally substituted with one or more groups selected from alkyl, halogen, -CN and =O; or alkyl optionally substituted by one or more groups selected from halogen, hydroxy, alkoxy, -NR a R b, -NRC R, -NRC O(alkyl), -NRC N 2, -C OR, thiol, alkylthiol, nitro, -CN, =O, -OC H, -OC (alkyl), -OC O(alkyl), -OC N 2 and -C NR a R b; R 3 is alkyl, haloalkyl, hydroxyalkyl, alkoxyalkyl, cycloalkyl, monocyclic non-aromatic heterocycle, monocyclic heteroaromatic or phenyl, wherein the phenyl, monocyclic non-aromatic heterocycle, and monocyclic heteroaromatic group represented by R 3 are optionally substituted with one or more groups selected from alkyl, halogen, haloalkyl, alkoxy, haloalkoxy, nitro and -CN; R 4 is halogen, -CN, -OR, -SR, -N 2, -C R, -C OR, -OC O(alkyl), -C O(haloalkyl), -OC R, -C N 2, -OC N 2, -NRC R, -NRC O(alkyl), -S R, -SO 2 R, -SO 2 N 2, -NRS R, -NRSO 2 R, -NRC N 2, -NRSO 2 N 2, haloalkyl, haloalkoxy, cycloalkoxy, cycloalkyl, monocyclic non-aromatic heterocycle, monocyclic heteroaromatic or alkyl, wherein the monocyclic non-aromatic heterocycle, monocyclic heteroaromatic and alkyl group represented by R 4 are optionally substituted with one or more groups selected from -CN, -OR, -SR, -N 2, =O, -C R, -C OR, -C O(haloalkyl), -OC R, -OC O(alkyl), -C N 2, -OC N 2, -NRC R, -NRC O(alkyl),-S R, -SO 2 R, -SO 2 N 2, -NRS R, -NRSO 2 R, -NRC N 2 and -NRSO 2 N 2; Each R independently is H or alkyl; R a and R b are independently H, alkyl or R a and R b can be taken together with the nitrogen to which they are attached to form a monocyclic non-aromatic heterocycle; and R c is H, alkyl, or halogen. X is N or CR c; R 1 is alkyl or -NR a R b; R 2 is H; halogen; -CN; -NRC R; -C OR; -C NR a R b; monocyclic heteroaromatic optionally substituted with one or more groups selected from alkyl, -CN, -NRC R,-C OR, -C NR a R b and halogen; monocyclic non-aromatic heterocycle optionally substituted with one or more groups selected from alkyl, halogen, -CN and =O; or alkyl optionally substituted by one or more groups selected from halogen, hydroxy, alkoxy, -NR a R b, -NRC R, -NRC O(alkyl), -NRC N 2, -C OR, thiol, alkylthiol, nitro, -CN, =O, -OC H, -OC (alkyl), -OC O(alkyl), -OC N 2 and -C NR a R b; R 3 is alkyl, haloalkyl, hydroxyalkyl, alkoxyalkyl, cycloalkyl, monocyclic non-aromatic heterocycle, monocyclic heteroaromatic or phenyl, wherein the phenyl, monocyclic non-aromatic heterocycle, and monocyclic heteroaromatic group represented by R 3 are optionally substituted with one or more groups selected from alkyl, halogen, haloalkyl, alkoxy, haloalkoxy, nitro and -CN; R 4 is halogen, -CN, -OR, -SR, -N 2, -C R, -C OR, -OC O(alkyl), -C O(haloalkyl), -OC R, -C N 2, -OC N 2, -NRC R, -NRC O(alkyl), -S R, -SO 2 R, -SO 2 N 2, -NRS R, -NRSO 2 R, -NRC N 2, -NRSO 2 N 2, haloalkyl, haloalkoxy, cycloalkoxy, cycloalkyl, monocyclic non-aromatic heterocycle, monocyclic heteroaromatic or alkyl, wherein the monocyclic non-aromatic heterocycle, monocyclic heteroaromatic and alkyl group represented by R 4 are optionally substituted with one or more groups selected from -CN, -OR, -SR, -N 2, =O, -C R, -C OR, -C O(haloalkyl), -OC R, -OC O(alkyl), -C N 2, -OC N 2, -NRC R, -NRC O(alkyl),-S R, -SO 2 R, -SO 2 N 2, -NRS R, -NRSO 2 R, -NRC N 2 and -NRSO 2 N 2; Each R independently is H or alkyl; R a and R b are independently H, alkyl or R a and R b can be taken together with the nitrogen to which they are attached to form a monocyclic non-aromatic heterocycle; and R c is H, alkyl, or halogen.