A compound of formula or a pharmaceutically acceptable salt thereof: wherein: G is aryl or a 5-6 membered heteroaromatic group or 8-11 membered heteroaromatic group, which may be benzofused or optionally substituted by 1, 2, 3, or 4 substituents selected from the group consisting of halogen, cyano, hydroxyl, amino, C 1-4 alkylamino, C 1-4 alkyl, haloC 1-4 alkyl, C 1-4 alkoxy, haloC 1-4 alkoxy, C 1-4 alkanoyl, SF 5, C(=O)NH 2, and C(=O)OR 4; W is S, SO 2, O, or NR 4; n is 0 or 1; m is 1 or 2; p is 1 or 2; q is 1; z is an integer ranging from 1 to 7; R is independently hydrogen or C 1-4 alkyl; R 1 is hydrogen, C 1-4 alkyl, or C 1-4 alkoxy; R 2 is hydrogen, F, C 1-4 alkyl, OH, or C 1-4 alkoxy; R 3 is hydrogen, F, C 1-4 alkyl, or C 1-4 alkoxy; R 4 is hydrogen, or C 1-4 alkyl; G 1 is a phenyl group or a 5-6-membered heteroaromatic group or a 8-11 membered heteroaromatic group, any of which groups may be optionally substituted by 1, 2, 3. or 4 substituents selected from the group consisting of halogen, cyano, hydroxyl, amino, C 1-4 alkylamino, C 1-4 alkyl, haloC 1-4 alkyl, C 1-4 alkoxy, C 1-4 alkanoyl, SF 5, C(=O)NH 2, and C(=O)OR 4; Y is a moiety selected from the group consisting of: phenyl, 5-6 membered heteroaromatic group, saturated mono 3-7 membered carbocyclic group, or 8-11 membered bicyclic carbocyclic group in which one or more atom carbons may be replaced by NR 4, O, or S; any of which groups may be optionally substituted by one or two substituents selected from the group consisting of halogen, cyano, hydroxyl, amino, C 1-4 alkylamino, C 1-4 alkyl, haloC 1-4 alkyl, C 1-4 alkoxy, haloC 1-4 alkoxy, C 1-4 alkanoyl, SF 5, C(=O)NH 2, SO 2 NH 2, C(=O)O x R 4, wherein x is 0 or 1, or Y'; and Y' is phenyl, or a 5-6-membered heteroaromatic group optionally substituted by 1 or 2 R 2 groups; with the proviso that G 1, Y and Y' are not simultaneously phenyl. G is aryl or a 5-6 membered heteroaromatic group or 8-11 membered heteroaromatic group, which may be benzofused or optionally substituted by 1, 2, 3, or 4 substituents selected from the group consisting of halogen, cyano, hydroxyl, amino, C 1-4 alkylamino, C 1-4 alkyl, haloC 1-4 alkyl, C 1-4 alkoxy, haloC 1-4 alkoxy, C 1-4 alkanoyl, SF 5, C(=O)NH 2, and C(=O)OR 4; W is S, SO 2, O, or NR 4; n is 0 or 1; m is 1 or 2; p is 1 or 2; q is 1; z is an integer ranging from 1 to 7; R is independently hydrogen or C 1-4 alkyl; R 1 is hydrogen, C 1-4 alkyl, or C 1-4 alkoxy; R 2 is hydrogen, F, C 1-4 alkyl, OH, or C 1-4 alkoxy; R 3 is hydrogen, F, C 1-4 alkyl, or C 1-4 alkoxy; R 4 is hydrogen, or C 1-4 alkyl; G 1 is a phenyl group or a 5-6-membered heteroaromatic group or a 8-11 membered heteroaromatic group, any of which groups may be optionally substituted by 1, 2, 3. or 4 substituents selected from the group consisting of halogen, cyano, hydroxyl, amino, C 1-4 alkylamino, C 1-4 alkyl, haloC 1-4 alkyl, C 1-4 alkoxy, C 1-4 alkanoyl, SF 5, C(=O)NH 2, and C(=O)OR 4; Y is a moiety selected from the group consisting of: phenyl, 5-6 membered heteroaromatic group, saturated mono 3-7 membered carbocyclic group, or 8-11 membered bicyclic carbocyclic group in which one or more atom carbons may be replaced by NR 4, O, or S; any of which groups may be optionally substituted by one or two substituents selected from the group consisting of halogen, cyano, hydroxyl, amino, C 1-4 alkylamino, C 1-4 alkyl, haloC 1-4 alkyl, C 1-4 alkoxy, haloC 1-4 alkoxy, C 1-4 alkanoyl, SF 5, C(=O)NH 2, SO 2 NH 2, C(=O)O x R 4, wherein x is 0 or 1, or Y'; and Y' is phenyl, or a 5-6-membered heteroaromatic group optionally substituted by 1 or 2 R 2 groups; with the proviso that G 1, Y and Y' are not simultaneously phenyl.