A compound according to the formula I: or a pharmaceutically acceptable salt thereof, wherein: A is selected from: aryl and heteroaryl, wherein each aryl and heteroaryl is unsubstituted or substituted with 1, 2, 3 or 4 substituents selected from R a; B is selected from: aryl, -O-aryl, -(CH 2) p -O-aryl, -O-(CH 2) p -aryl, heteroaryl, -O-heteroaryl, -(CH 2) p -O-heteroaryl, -O-(CH 2) p -heteroaryl, -C 3-10 cycloalkyl, -(CH 2) p -O-C 3-10 cycloalkyl, -O-(CH 2) p -C 3-10 cycloalkyl, -C 2-10 cycloheteroalkyl, -(CH 2) p -O-C 2-10 cycloheteroalkyl, and -O-(CH 2) p -C 3-10 cycloheteroalkyl, wherein each -CH 2, cycloalkyl, cycloheteroalkyl, aryl, and heteroaryl is unsubstituted or substituted with 1, 2 or 3 or 4 substituents selected from R b; R 1 is selected from: hydrogen, and halogen; R 2 is selected from: halogen, -C 1-6 alkyl, -C 2-6 alkenyl, -C 2-6 alkynyl, and -CN, wherein each alkyl, alkenyl and alkynyl is unsubstituted or substituted with 1-3 substituents selected from: halogen, OH, -NH 2, -NH(C 1-6 alkyl), -N(C 1-6 alkyl) 2 and -OC 1-6 alkyl; each R a is independently selected from: halogen, and -C 1-6 alkyl, wherein each alkyl is unsubstituted or substituted with 1-3 substituents selected from: -C 1-6 alkyl and halogen; each R b is independently selected from: halogen, -CN, -OH, -C 1-6 alkyl, -C 2-6 alkenyl, -C 2-6 alkynyl, -O-C 1-6 alkyl, -O-C 2-6 alkenyl, -O-C 2-6 alkynyl, -C 3-10 cycloalkyl, -C 3-10 cycloalkenyl, aryl, heteroaryl, -OC 3-10 cycloalkyl, -OC 3-6 cycloheteroalkyl, -O-aryl, -O-heteroaryl, -NH 2, -NHC 1-6 alkyl, -N(C 1-6 alkyl) 2, -SC 1-6 alkyl, -SOC 1-6 alkyl, and -SO 2 C 1-6 alkyl, wherein each alkyl, alkenyl, alkynyl, cycloalkyl, cycloalkenyl, cycloheteroalkyl, aryl and heteroaryl is unsubstituted or substituted with 1-3 substituents selected from: -C 1-6 alkyl, -OC 1-6 alkyl, -CF 3, -OCF 3, and halogen; n is 1 or 2; m is 0, 1, or 2; p is 1, 2, or 3; and q is 0 or 1. A is selected from: aryl and heteroaryl, wherein each aryl and heteroaryl is unsubstituted or substituted with 1, 2, 3 or 4 substituents selected from R a; aryl and heteroaryl, B is selected from: aryl, -O-aryl, -(CH 2) p -O-aryl, -O-(CH 2) p -aryl, heteroaryl, -O-heteroaryl, -(CH 2) p -O-heteroaryl, -O-(CH 2) p -heteroaryl, -C 3-10 cycloalkyl, -(CH 2) p -O-C 3-10 cycloalkyl, -O-(CH 2) p -C 3-10 cycloalkyl, -C 2-10 cycloheteroalkyl, -(CH 2) p -O-C 2-10 cycloheteroalkyl, and -O-(CH 2) p -C 3-10 cycloheteroalkyl, wherein each -CH 2, cycloalkyl, cycloheteroalkyl, aryl, and heteroaryl is unsubstituted or substituted with 1, 2 or 3 or 4 substituents selected from R b; aryl, -O-aryl, -(CH 2) p -O-aryl, -O-(CH 2) p -aryl, heteroaryl, -O-heteroaryl, -(CH 2) p -O-heteroaryl, -O-(CH 2) p -heteroaryl, -C 3-10 cycloalkyl, -(CH 2) p -O-C 3-10 cycloalkyl, -O-(CH 2) p -C 3-10 cycloalkyl, -C 2-10 cycloheteroalkyl, -(CH 2) p -O-C 2-10 cycloheteroalkyl, and -O-(CH 2) p -C 3-10 cycloheteroalkyl, R 1 is selected from: hydrogen, and halogen; hydrogen, and halogen; R 2 is selected from: halogen, -C 1-6 alkyl, -C 2-6 alkenyl, -C 2-6 alkynyl, and -CN, wherein each alkyl, alkenyl and alkynyl is unsubstituted or substituted with 1-3 substituents selected from: halogen, OH, -NH 2, -NH(C 1-6 alkyl), -N(C 1-6 alkyl) 2 and -OC 1-6 alkyl; halogen, -C 1-6 alkyl, -C 2-6 alkenyl, -C 2-6 alkynyl, and -CN, each R a is independently selected from: halogen, and -C 1-6 alkyl, wherein each alkyl is unsubstituted or substituted with 1-3 substituents selected from: -C 1-6 alkyl and halogen; halogen, and -C 1-6 alkyl, each R b is independently selected from: halogen, -CN, -OH, -C 1-6 alkyl, -C 2-6 alkenyl, -C 2-6 alkynyl, -O-C 1-6 alkyl, -O-C 2-6 alkenyl, -O-C 2-6 alkynyl, -C 3-10 cycloalkyl, -C 3-10 cycloalkenyl, aryl, heteroaryl, -OC 3-10 cycloalkyl, -OC 3-6 cycloheteroalkyl, -O-aryl, -O-heteroaryl, -NH 2, -NHC 1-6 alkyl, -N(C 1-6 alkyl) 2, -SC 1-6 alkyl, -SOC 1-6 alkyl, and -SO 2 C 1-6 alkyl, wherein each alkyl, alkenyl, alkynyl, cycloalkyl, cycloalkenyl, cycloheteroalkyl, aryl and heteroaryl is unsubstituted or substituted with 1-3 substituents selected from: -C 1-6 alkyl, -OC 1-6 alkyl, -CF 3, -OCF 3, and halogen; halogen, -CN, -OH, -C 1-6 alkyl, -C 2-6 alkenyl, -C 2-6 alkynyl, -O-C 1-6 alkyl, -O-C 2-6 alkenyl, -O-C 2-6 alkynyl, -C 3-10 cycloalkyl, -C 3-10 cycloalkenyl, aryl, heteroaryl, -OC 3-10 cycloalkyl, -OC 3-6 cycloheteroalkyl, -O-aryl, -O-heteroaryl, -NH 2, -NHC 1-6 alkyl, -N(C 1-6 alkyl) 2, -SC 1-6 alkyl, -SOC 1-6 alkyl, and -SO 2 C 1-6 alkyl, n is 1 or 2; m is 0, 1, or 2; p is 1, 2, or 3; and q is 0 or 1.