A compound of formula I or pharmaceutically acceptable salts thereof is provided; wherein each of R1, R1, R2, R3, R4, n and Ar are as defined in the description that they are agonists or partial agonists of the 2C subtype of brain serotonin receptors. The compounds, and compositions containing the compounds, can be used to treat a variety of disorders of the central nervous system such as schizophrenia.