A compound of structural formula I: or pharmaceutically acceptable salts and individual enantiomers and diastereomers thereof; for use in treating or preventing chronic or acute pain, treating or controlling epilepsy, or enhancing the quality of sleep in a mammalian patient in need thereof; wherein: A represents thienopyrazolyl, indazolyl,or indolyl; B represents, a bond, C 1-6 alkyl, C 2-6 alkenyl, C 3-10 cycloalkyl, C 5-10 heterocyclyl, or C 6-10 aryl; R 1 represents H, C 1-6 alkyl, halogen, (CH 2) n CF 3, C 3-10 cycloalkyl, C(R 2) 2 OH, -O-, CN, n OR 2, NHC R 2, (CH 2) n C 5-10 heterocyclyl, (CH 2) n C 6-10 aryl, or C 1-6 alkoxy; said alkyl, cycloalkyl, heterocyclyl and aryl optionally substituted with 1 to 3 groups of C 1-6 alkyl, halogen, hydroxyl, (CH 2) n CF 3,or CN; R2 represents H; R3 is selected from the group consisting of (CHR y) n pyridyl, (CHR y) n oxidopyridyl, (CHR y) n pyrimidinyl, (CHR y) n triazolyl, (CHR y) n phenyl, (CHR y) n pyrazinyl, (CHR y) n pyrazolyl, (CHR y) n oxadiazolyl, (CHR y) n thiazolyl, (CHR y) n thiadiazolyl, (CHR y) n indazopyridyl,, C 1-6 alkyl, and (CHR y) n C 3-6 cycloalkyl, all of which are optionally substituted with 1 to 3 groups of R a, and wherein R y represents H, CF 3, OH or C 1-6 alkyl which is optionally substituted with 1 to 3 groups of R a; or R 2 and R 3 can be combined with the nitrogen to which they are attached to form a C 5-10 heterocyclyl optionally substituted with 1 to 3 groups of R a; R 4 and R 5 independently represent H, n OR 2, CHF 2, (CH 2) n C 5-10 heterocyclyl, (CH 2) n C 6-10 aryl, C 3-10 cycloalkyl, C 1-6 alkoxy, C 2-6 alkenyl, CF 3, CF 2, C 1-2 R 2, or C 1-6 alkyl; said alkyl, cycloalkyl, heterocyclyl and aryl optionally substituted with 1 to 3 groups of R a; R6 represents hydrogen, OR 2, (CH 2) n CF 3, halogen, C(R 2) 2 OR 2, C 1-6 alkyl, C 2-6 alkenyl, C 2-6 alkynyl, C 3-10 cycloalkyl, (CH 2) n C 6-10 aryl, (CH 2) n C 5-10 heterocyclyl, said alkyl, cycloalkyl, aryl and heterocyclyl optionally substituted with 1 to 3 groups of R a; R a represents C 1-6 alkyl, halogen, hydroxyl, OR 2 (CH 2) n CF 3, -O-, C 3-6 cycloalkyl, NR 2 C R 2, C N(R 2) 2, C(R 2) 2 OR 2, C R 2, O(CH 2) n C N(R 2) 2, O(CH 2) n C OR 2, C C 5-10 heterocyclyl,NO 2, CN, N(R 2) 2, C OR 2, SO 2 R 2, OR 2, (CH 2) n C 5-10 heterocyclyl, or (CH 2) n C 6-10 aryl, said alkyl, heterocyclyl and aryl optionally substituted with 1 to 3 groups of C 1-6 alkyl, halogen, hydroxyl, (CH 2) n CF 3, or CN; and n represents 0 to 4. A represents thienopyrazolyl, indazolyl,or indolyl; B represents, a bond, C 1-6 alkyl, C 2-6 alkenyl, C 3-10 cycloalkyl, C 5-10 heterocyclyl, or C 6-10 aryl; R 1 represents H, C 1-6 alkyl, halogen, (CH 2) n CF 3, C 3-10 cycloalkyl, C(R 2) 2 OH, -O-, CN, n OR 2, NHC R 2, (CH 2) n C 5-10 heterocyclyl, (CH 2) n C 6-10 aryl, or C 1-6 alkoxy; said alkyl, cycloalkyl, heterocyclyl and aryl optionally substituted with 1 to 3 groups of C 1-6 alkyl, halogen, hydroxyl, (CH 2) n CF 3,or CN; R2 represents H; R3 is selected from the group consisting of (CHR y) n pyridyl, (CHR y) n oxidopyridyl, (CHR y) n pyrimidinyl, (CHR y) n triazolyl, (CHR y) n phenyl, (CHR y) n pyrazinyl, (CHR y) n pyrazolyl, (CHR y) n oxadiazolyl, (CHR y) n thiazolyl, (CHR y) n thiadiazolyl, (CHR y) n indazopyridyl,, C 1-6 alkyl, and (CHR y) n C 3-6 cycloalkyl, all of which are optionally substituted with 1 to 3 groups of R a, and wherein R y represents H, CF 3, OH or C 1-6 alkyl which is optionally substituted with 1 to 3 groups of R a; or R 2 and R 3 can be combined with the nitrogen to which they are attached to form a C 5-10 heterocyclyl optionally substituted with 1 to 3 groups of R a; R 4 and R 5 independently represent H, n OR 2, CHF 2, (CH 2) n C 5-10 heterocyclyl, (CH 2) n C 6-10 aryl, C 3-10 cycloalkyl, C 1-6 alkoxy, C 2-6 alkenyl, CF 3, CF 2, C 1-2 R 2, or C 1-6 alkyl; said alkyl, cycloalkyl, heterocyclyl and aryl optionally substituted with 1 to 3 groups of R a; R6 represents hydrogen, OR 2, (CH 2) n CF 3, halogen, C(R 2) 2 OR 2, C 1-6 alkyl, C 2-6 alkenyl, C 2-6 alkynyl, C 3-10 cycloalkyl, (CH 2) n C 6-10 aryl, (CH 2) n C 5-10 heterocyclyl, said alkyl, cycloalkyl, aryl and heterocyclyl optionally substituted with 1 to 3 groups of R a; R a represents C 1-6 alkyl, halogen, hydroxyl, OR 2 (CH 2) n CF 3, -O-, C 3-6 cycloalkyl, NR 2 C R 2, C N(R 2) 2, C(R 2) 2 OR 2, C R 2, O(CH 2) n C N(R 2) 2, O(CH 2) n C OR 2, C C 5-10 heterocyclyl,NO 2, CN, N(R 2) 2, C OR 2, SO 2 R 2, OR 2, (CH 2) n C 5-10 heterocyclyl, or (CH 2) n C 6-10 aryl, said alkyl, heterocyclyl and aryl optionally substituted with 1 to 3 groups of C 1-6 alkyl, halogen, hydroxyl, (CH 2) n CF 3, or CN; and n represents 0 to 4.