Compound of formula Ia: and pharmaceutically acceptable salts thereof, wherein: p is selected from 0 and 1; n is 1-3; q is 1; R5 is selected from hydrogen, C1-6 alkyl, -XNR7R8, C6-10 aryl-C0-4 alkyl, C1-10 heteroaryl, C0-4 cycloalkyl, C3-10 cycloalkyl, and C3-4 alkylcycloalkyl alkyl C0-4; R7 and R8 are independently selected from hydrogen and C1-4 alkyl; and R6 is selected from hydrogen and C1-6 alkyl; or R5 and R6 together with the nitrogen to which R5 and R6 are both attached form C1-10 heteroaryl or C3-8 heterocycloalkyl; wherein any aryl, heteroaryl, cycloalkyl and heterocycloalkyl of R5 or the combination of R5 and R6 may be optionally substituted with 1 to 3 radicals independently selected from halo, nitro, cyano, hydroxyl, C1-6 alkyl, C1-6 alkoxy , halo substituted alkyl, halo substituted alkoxy, -XNR7R8, XOR7, -XNR7S (O) 2R8, - XNR7S (O) R8, -XNR7SR8, -XC (O) NR7R8, -XC (O) NR7XNR7R8, -XNR7C ( O) NR7R8, XNR7XNR7R8, -XNR7XOR7, -XNR7C (= NR7) NR7R8, -XS (O) 2R9, -XNR7C (O) R8, -XNR7C (O) R9, -XR9, XC (O) OR8, -XS ( O) 2NR7R8, -XS (O) NR7R8 and - XSNR7R8; wherein X is a C1-4 bond or alkylene; R7 and R8 are independently selected from hydrogen and C1-4 alkyl; and R9 is selected from C3-10 heterocycloalkyl and C1-10 heteroaryl; wherein said heterocycloalkyl or heteroaryl of R9 is optionally substituted with a radical selected from C1-4 alkyl, -XNR7XNR7R7, XNR7XOR7 and -XOR7; wherein X is a C1-4 alkylene bond or optionally substituted with 1 to 2 C1-6 alkyl radicals and R7 is selected from hydrogen, and C1-4 alkyl; R10 is selected from hydrogen and C1-6 alkyl; R15 is selected from halo, nitro, cyano, hydroxyl, C1-6 alkyl, C1-6 alkoxy, halo substituted alkyl and halo substituted alkoxy; and R16 is selected from halo, methoxy, nitro, -NR12C (O) R13, -OR13, -C (O) NR12R12, -NR12R12, NR12C (O) NR12R13, - C (O) OR12, -C (O) NR12R13 , -NR12S (O) 0-2R13 and -S (O) 0-2NR12R13; wherein each R12 is independently selected from hydrogen and C1-6 alkyl; R13 is selected from C6