12123Compounds of the general formula (I) wherein one of X and X represents N and the other one of X and X represents C(CH) A represents unsubstituted or substituted 5 6 or 10 membered aryl or heteroaryl n is 0 or 1 and B is a bicyclic heteromoiety defined in the specification. Compounds are phosphodiesterase 10A inhibitors and can find use in medicine in the treatment psychotic neurological and cognitive functions diseases and disorders. (I)